Localize a program in C#

[Localize a program]
[Localize a program]

Globalization is the process of building an application that can be used by users from different cultures.

Localization is the process of customizing a globalized application for a specific culture.

To localize an application:

  • Build an application as usual. Place controls on the forms, set their text, and so forth. Use the language that you want to be the default for the application.
  • Set a form’s Localizable property to true.
  • Set the form’s Language property to a new language for which you want to localize.
  • Change control properties to work with the new language.

    That’s all there is to it! At runtime, the program automatically checks the system’s locale and selects the appropriate user interface.

    The exact result you get depends on how the system’s locale matches the locales you have prepared the program to handle.

    If there is an exact match, you get the specific interface you built. For example, you if localized for German in Austria and that’s where the computer is, that’s the interface you get.

    If there’s a non-exact match, you’ll get a less specific interface. For example, if you localized for generic German and the computer is localized for German in Austria, then the program uses the generic German interface.

    If there’s no match, you get the default locale. For example, if you did not localize for any Spanish locale and the computer is localized for Spanish in Peru, then the program uses the default interface that you used to initially create it.

    For a list of more than 100 culture values that you can use in code, such as en-US and de-DE, see Microsoft’s Table of Language Culture Names, Codes, and ISO Values Method.

    Download Example   Follow me on Twitter   RSS feed   Donate

  • This entry was posted in globalization, internationalization, localization and tagged , , , , , , , , , , , , , . Bookmark the permalink.

    2 Responses to Localize a program in C#

    1. Pingback: Test localized programs in C# - C# HelperC# Helper

    2. Pingback: List available culture codes in C# - C# HelperC# Helper

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.