Implementing multiple languages (C#)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • leimeisei
    New Member
    • Aug 2008
    • 4

    Implementing multiple languages (C#)

    Hi,

    I've been writing an app, but have recently discovered the need to go multilingual (I need primarily German). So, I was wondering, what is the best way to implement multiple languages in a C# (or any Object-oriented) environment?

    My plan as of right now is to use XML files with a bunch of id/value pairs (ID might be WELCOME_STRING and value for German would be Willkommen, for example.) In the base code that loads the saved application preferences, I would use a method to parse the proper XML, based on what language was saved as the user's preference, and put it into a Language object that I implemented. Each language object has a List of WordTranslation objects that each contain an id/value pair. This language object would be passed from form to form and the initialization method on each form would use the Language object to change the text properties of any labels/buttons/dialog boxes.

    Is this an okay way to do it, or is there a better way that anyone knows? Any help at all would be appreciated.
  • mldisibio
    Recognized Expert New Member
    • Sep 2008
    • 191

    #2
    Just to get you started, do a search on Framework "Globalizat ion" and "Localizati on". The Framework has built-in model to support your task, which is a common requirement.

    MSDN: Introduction to Internationaliz ation in the .NET Framework

    A great resource is Addison-Wesley:

    .NET Internationaliz ation: The Developer's Guide to Building Global Windows and Web Applications
    by Guy Smith-Ferrier

    Comment

    Working...