Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Globalize an existing Windows Forms application?

I have an existing winforms application developed using VS 2005 and .net framework 2.0.

Now we need to globalize this application. The two locales are German and Japanese.

I know we can use form's localize property to create localized form resources and can have other resource files for strings used in message boxes, exceptions etc..

I want to know the best approach to globalize an existing application, should I set the localize property on each form or is there some tool which will extract the the label names and control names..what considerations to be taken for date formats, currency, etc.

Also we have used some composite strings in some places in code to concat the message strings, how these can be localized?

We will be migrating the application to VS 2008 and .net framework 3.5 before starting globalization activity.

like image 684
ksa Avatar asked Oct 05 '09 11:10

ksa


2 Answers

I've only worked with LTR languages, and I haven't touched Japanese. With that in mind, here are some of my best practices off the top of my head:

  • Put all language-specific programmatic strings and string fragments into a .resx file (I like to use one .resx file per dialog box), then call on the strings using the auto-generated classes and properties. There shouldn't be any language-specific strings remaining in your code (which means almost no strings in your code, period). A good pattern is to put formatting strings into the .resx as well, since the syntax of a language varies.
  • Set the Localizable property to True on all your forms and make language-specific changes on there directly (use the Language property).
  • Design your forms so that anything that displays language-specific strings will have extra space where needed (note: German is longer than English). IMO, forms should not have to be completely rearranged for a basic change in language -- it may have to be done with a language like Japanese, though.
  • For controls such as labels that need their text dynamically set, set the text on the form so that you know it's only a marker. I use "##" for this, which really stands out. Avoid setting the text to a "sample" of the dynamic text, because you'll never remember which controls get set dynamically by just looking at the form.
like image 88
Jon Seigel Avatar answered Oct 04 '22 06:10

Jon Seigel


It is better to set the localization property on each form -- that will extract not only the strings, but also the geometry of the various components, into the base .resx file. With the nominated languages, it is quite unlikely that the original sizes of the components will be a good fit for the translation.

It is generally not recommended to compose strings out of fragments because they in general will not map into the same pattern of fragments in a different language. Use of formatted strings (String.Format) to drop in values, yes, but anything that relies on the grammar and sentence order of the original language is unlikely to fit.

like image 20
Steve Gilham Avatar answered Oct 04 '22 07:10

Steve Gilham