locked
Are there globalization tools like "Generate Local Resource" available for Windows Forms Applications ? RRS feed

  • Question

  • Hello !

    When using Web Forms designer, in Visual Studio 2005/2008, in Tools menu, there are a "Generate Local Resource" option. This tool add a tag in our file. Automatically, include in resource file all strings to be used in Text or Tooltip property for any component in the current designer. If I try to change the Text property directly in "Properties Window", you will see a little image beside the property name, indicating that property is linked using meta:resourceKey.

    I'm looking for this same tool but that works with Windows Forms.

    If this tool don't exists, there are some "Custom Attribute" to make Globalization or Internationalization in WinForms ?

    Thanks for all help.
    Regards,
    Andre Abrantes

    Monday, July 27, 2009 5:03 PM

Answers

  • It is built right into the designer.  Set the form's Localizable property to True.  Switch the language for editing strings with the Language property.
    Hans Passant.
    Monday, July 27, 2009 5:45 PM
  • Set the Localizable property at the Form Level.

    Then design your form in the default language e.g. English
    Then change the Language Property of the Form to the next language e.g. French
    Then go thru the controls in the form and set the text property to the French Equivalents

    This will autotically generate the required resource files.

     


    Regards, Anand Mukundan http://www.dotnetindia.com

    • Proposed as answer by AnandMVP Monday, August 3, 2009 4:36 PM
    • Marked as answer by Andre Abrantes Monday, August 3, 2009 9:00 PM
    Monday, August 3, 2009 4:35 PM

All replies

  • It is built right into the designer.  Set the form's Localizable property to True.  Switch the language for editing strings with the Language property.
    Hans Passant.
    Monday, July 27, 2009 5:45 PM
  • Set the Localizable property at the Form Level.

    Then design your form in the default language e.g. English
    Then change the Language Property of the Form to the next language e.g. French
    Then go thru the controls in the form and set the text property to the French Equivalents

    This will autotically generate the required resource files.

     


    Regards, Anand Mukundan http://www.dotnetindia.com

    • Proposed as answer by AnandMVP Monday, August 3, 2009 4:36 PM
    • Marked as answer by Andre Abrantes Monday, August 3, 2009 9:00 PM
    Monday, August 3, 2009 4:35 PM
  • Hi Andre,

    While you do have to set Localizable to true for each of your forms, once you've done that, the way to accomplish what you're looking for is:

    (from command line)

    copy *.resx *.[culture].resx

    After running the above command line, view the Solution Explorer for your project and opt to show all files.  Select the new resx files (they'll show up as non project files) and include each one in your project.

    So if I've just enabled localization on all of my forms, and I want to get all the files I need for a spanish translator, I'd run "copy *.resx *.es.resx" from the command line within the appropriate directory.  Next, I'd use the Visual Studio interface to ensure each new resx is part of my project.  Finally, I'd bundle *.es.resx into a zip file and shoot my translator a link to the .net resource file editor.

    I'm sure building a custom action / macro for this within Visual Studio is possible but the command line makes it pretty painless.  The most time consuming part is adding the new resx files to the project... 

    You certainly don't have to step through every form field and every form in your application to get the files you're looking for, though that approach will result in far cleaner resx files, as only .Text properties will end up in the alternate resx files if you go control by control, form by form...

    Brian

    Sunday, May 29, 2011 3:41 PM