Localizing only selected properties

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to localize my SmartDevice project, but I only want to localize the
Text properties. As it is, if I set Localizable = True on my form I get a
ton of unnecessary properties localized, my resource file is bloated, and my
form takes a long time to load.

How can I accomplish this?
 
The Localizable property will create separate resx files for each culture.
If you don't want to do that, then set the Localizable to false and delete
any unwanted resx files.

If you want to localize selected elements, then I recommend using Resource
files so you can localize your selected text. For example start with a
resource file named AppStrings.resx which contains your native language.
Then for example if you want to add other cultures such as french, create an
AppStrings.fr-FR.resx which is french in France.
Use the ResourceManager class to load the resource strings once you have set
your culture.
Do a search on MSDN for Resource files and localization in .NET for more
information on this subject.

Simon.
 
If I turn off the Localizable property and load resource strings in the
InitializeComponent method, then I cannot use the forms editor. It will
either fail to load the form for editing or replace all of my edits.

Any way to localize selected properties of controls on a form and still use
the forms editor?

I know I can write a method to assign all of the localized strings outside
InitializeComponent, but that's pretty wasteful since the strings are
duplicated in the assembly--not a good thing when space is at a premium on a
smartphone.
 
If I turn off the Localizable property and load resource strings in the
InitializeComponent method, then I cannot use the forms editor. It will
either fail to load the form for editing or replace all of my edits.
Any way to localize selected properties of controls on a form and still
use
the forms editor?

No you can't do this.
I know I can write a method to assign all of the localized strings outside
InitializeComponent, but that's pretty wasteful since the strings are
duplicated in the assembly--not a good thing when space is at a premium on
a
smartphone.

How you localize strings outside of the editor generally, (if you are to
localize this way) is to use code and forget about the designer for your
selected localized UI widgets. This way you are not duplicating any text.
 
Back
Top