Changed Language System and Strings files (1 Viewer)

James

Retired Team Member
  • Premium Supporter
  • May 6, 2005
    1,385
    67
    Switzerland
    The Language string system has been replaced.

    The new system includes:
    * New file format
    * Hierarchical language support
    * User defined language strings


    The hierarchical system works like this:

    1. User strings
    2. Selected language
    3. Selected language parent (if exists)
    4. Default English

    If the Selected language is English then steps 3 and 4 don't apply. That means that if strings are not found at the one level the strings from the next level will be used instead.

    This enables the user strings file to just contain a few strings, and also if regional languages are required they do not need to be complete, but only have the differences to the parent language.

    For example, if there was a string file for Swiss German it would be called strings_de-CH.xml and might look like:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <Language name="Schwiizertüütsch" characters="255">
      <Section name="unmapped">
        <String id="11">Mäntig</String>
        <String id="12">Zischtig</String>
        <String id="13">Mittwuch</String>
        <String id="14">Dunschtig</String>
        <String id="15">Fritig</String>
        <String id="16">Samschtig</String>
        <String id="17">Sunntig</String>
      </Section>
    </Language>

    Then any strings not found here would be used from the Standard German file strings_de.xml. If any strings are not found there then English (strings_en.xml) will be used.

    This means the Swiss german language file never needs to contain all the strings, but only those that are different from the Standard German file.

    The same applies to the user string file strings_user.xml. For example if I want Sunday to be called "My Day" then the following can be used:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <Language name="Custom" characters="255">
      <Section name="unmapped">
        <String id="17">My Day</String>
      </Section>
    </Language>

    Also because the strings_user.xml file is not in the release it will not be over written by each update. At the moment this file needs to be in the main language directory. However, in the future this should be changed.

    The section name is for future use and at the moment is always "unmapped".

    Note: Spanish Latin users I could not convert this language file, because this is not a specific language for .NET. It needs to be linked to a language + country. For example: es-AR - Spanish (Argentina), es-CL - Spanish (Chile), etc. (see here for a list with more options: http://msdn2.microsoft.com/en-us/library/system.globalization.cultureinfo.aspx)
     

    Users who are viewing this thread

    Top Bottom