Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Language switching 1

Status
Not open for further replies.

eelisdotnet

Programmer
Oct 3, 2004
10
FI
Hi

I'm trying to find the better way how to change between languages on windows forms UI. Currently we have 2 languages (more in the future).
There's a simple language selector which upon selection, rewrite all the UI text to the selected language. Dynamic text and messages are also to be written according to selected language.

We were thinking of keeping all static and dynamic text on a csv or xml file with the relevant var as an identifier. Then everytime you have to display a message, you open the file and look for the specific var and get the message according to language selected. That way is easy to manage all messages and to add new languages, but require processor time in open/close the file.

Any suggestion ... thanks!
 
I would pick up a copy of:

Developing International Software, Second Edition
ISBN: 0735615837

It goes over all this.

The basics:
You isolate your language-variant strings into resource-only DLLs that are in directories under your main application, where the directories are named the same as the locale you're supporting:
Code:
MyApp.exe
  \en-us
    MyUSEnglishResources.dll
  \en-uk
    MyBritishEnglishResources.dll
  \de
    MyGenericGermanResources.dll
  \de-at
    MyAustrianGermanResources.dll
The .net runtime will find these DLLs automatically, based on the current thread's CultureInfo, and you have to write very little code to support it.

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
I would do some reading about

System.Globalization
System.Resources



- - - - - - - - - - - - - - - - - -
Im three apples high, Im blue, and i most certainly like that cold beer that should be every mans right after a hard days work!
 
I'm with Chip on this one, that's a damn good book to get to know if you are developing an internation/multi-language app.

-Rick

----------------------

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top