R – How to get all strings from a Form for localization

localizationnetwinforms

All articles I've read about localization of a WinForms application assume that I already have all the strings translated. According to the articles, I should just set the Localizable property to true and edit all the controls.

But how do I get all the original (English) strings from the form? Assume I have a complete application, which wasn't localized so far. Should I somehow manually parse the strings from the Designer file or is there any other, simpler approach?

I need to send the strings to the translators in Excel or Word. Since the translators don't have any experience with resources, I will finally move all the translated strings back to my forms and change the controls' sizes, positions etc. where needed.

EDIT: thanks to Rob's answer and comments, the solution is first to set the Localizable property to true. Then, I can easily copy all strings from the resx files that belong to the forms.

Best Answer

I you are doing localization the same way as I am, you just go into the Properties directory of your project and open the Resources.resx file in a text editor. In that, the strings are in XML nodes that look like this;

<data name="ErrorLaunching" xml:space="preserve">
  <value>Error launching Ivara</value>
  <comment>MessageBox text in LogonForm</comment>
</data>

Once you get them translated, they go into similarly named files like Resources.fr.resx for French.

You can also open Resources.resx in Visual Studio, select Strings and copy/paste into Excel.

Or, by your description, you might be doing localization on a per form basis. In that case, the above applies, except that it is the Resx file for your form that you are interested in.

Related Topic