I18N - Character mapping

From The DarkMod Wiki
Revision as of 19:19, 9 January 2012 by Tels (talk | contribs) (add note)
Jump to navigationJump to search

The D3 code that handles the GUI bitmap font can only load a specific range of bytes as characters. To get the most out of the available entries, a special font is used (Carleton for the menu f.i.). These fonts are build/patched so that the right characters appear in the right place.

Encodings

Note that the language files (f.i. strings/german.lang) as well as the readables and the FM dictionariaries are expected to be in the following encodings:

Remapping

The characters are remapped upon loading the dictionary/readable from their source encoding (e.g. ISO 8859-2) to the special character map TDM uses. Responsible for this are mapping files, f.i. "strings/czech.map". If a map file for a specific language is not found, "strings/default.map" is used instead.

The content of a map file is wrapped in { and }, and each mapping consists of two hexadecimal numbers, the source and the target character number.

Examples

For russian:

{
        0xFF    0xB6            // я
}

For European languages in ISO 8859-2 charset (f.i. Czech):

// a comment
{
        0xF2    0xA1            // ň
        0xDB    0xA2            // Ű (similiar to Ü, used in Hungarian)
        0xFB    0xA4            // ű
        0xA9    0xA6            // Š
        0xB9    0xA8            // š
        0xA1    0xAA            // Ą
        0xC8    0xAC            // Č
        0xCA    0xAB            // Ę
        0xE8    0xAE            // č
        0xD5    0xB0            // Ő (similiar to Ö, used in Hungarian)
        0xA3    0xB1            // Ł
        0xAb    0xB2            // Ť
        0xCF    0xB3            // Ď
        0xAC    0xB4            // Ž
        0xB3    0xB5            // ł
        0xBf    0xB6            // ż
        0xEF    0xB7            // ď
        0xBE    0xB8            // ž
        0xF5    0xB9            // ő (similiar to ö, used in Hungarian)
        0xB1    0xBA            // ą
        0xEA    0xBB            // ę
        0xF8    0xF7            // ř
        0xD8    0xD7            // Ř
        0xEC    0xA3            // ě
        0xCC    0xA5            // Ě
        0xD9    0xA9            // Ů
        0xF9    0xAF            // ů
        0xBB    0xB6            // ť
}
{{{1}}}


See Also

Translation resources

Overview of translations

Translation discussions