Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / August 2006

Tip: Looking for answers? Try searching our database.

Localization problem - settings keep getting reset for (default) l

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Markus Galuschka - 27 Aug 2006 04:04 GMT
I am currently developing an application that will be available in german and
english. I set the localizable attribute of all forms to true, english
text/settings are used with "(default)" as the language, german with "german"
as the language.

The text of buttons, etc is shown correctly (i.e. german on a german windows
and english on any other language version of windows). However, settings made
to buttons or forms are lost when i change from (default) to german and back
to (default). For example: I have a button on the form and the text is "Add".
I set the enabled property to false. Then I switch to german and change the
Text to "Hinzufügen" and change back to (default). Now the button text still
reads "Add", BUT enabled is now set to true!!! I did not change the enabled
property for the german language button at all, in fact, when I switch back
to german the button is still disabled.

It seems that any changes except for the actual text is reset whenever I
switch back to (default). Can anybody tell me why this is happening and how I
can prevent it?
Markus Galuschka - 27 Aug 2006 05:37 GMT
After a bit of testing it seems that the following happens:

When I change a setting (say of a button), code gets generated in
InitializeComponent() for example:

this.btnOK.Enabled = false;

When I then switch the language to German nothing happens. However, when I
switch back to (default) the following changes have been made:

1) this.btnOK.Enabled = false; has been removed from InitializeComponent()
2) form.de.resx now has this.btnOK.Enabled set to false instead
3) form.resx does NOT have this.btnOK.Enabled set to false. it does not have
the btnOK.Enabled property in it at all.

So since the code was removed from InitializeComponent and not placed in
form.resx the setting is lost.

I still do not understand why this happens.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.