Supporting Multiple Languages withen an application (Globalization)

Supporting multiple languages in a .net application is quick and simple. To demonstarte just how simple

1. open a winform project.

2. Select the Localizable property for the form = True (default is False)

3. Change the language property to a new Language (Language=Spanish)

4. Translate all labels to new language. (See. http://babelfish.altavista.com/ if you don't actually know any other languages)

And your done. If you change the language back to Default all your original label entries will come back.

Supporting multiple languages on a web page is slightly more difficult.

1. Create a resource File.

Resource files can be created by first makeing a txt file containing Key=Value pairs. Then compile the txt into a resource file with Resgen a tool that is provided by MS in thier .Net Framework SDK (http://www.microsoft.com/downloads/details.aspx?FamilyId=9B3A2CA6-3647-4070-9F41-A333C6B9181D&displaylang=en).

Write a new txt file for a new language using the same keys but different translations. Compile it placing the Language ID in the file name.

2. Create an instance of the Resource Manager

Personnaly I create an application wide instance of the Resource Manager in the Application onStart Event.

3. Use created instance of the ResourceManager to Getstring

 
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish