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

G

Guest

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?
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top