HLSW Language Config Files
From HLSW Wiki
Contents |
Description
The language files are located at cfg/language and contain translations of HLSW to other languages. In principle there exists for every string two field: the original english text and the translated text. HLSW uses only the translated text if the english text in the config file is equivalent to the english text stored in HLSW. So it is no problem to run HLSW with outdated language files.
HLSW must be restarted that language changes take affect.
File Naming
The language files follow a specific naming convention:
<lanid>-<sublanid> <name>.cfg
The lanid is the primary language identifier and sublanid the sublanguage identifier. Both values are hexadecimal coded. See [1] for a complete list of lanid/sublanid pairs and their meaning.
The name parameter is ignored by HLSW and is for conveniece to know which file contains which language.
Creating a new language
- Find out the primary and sublanguage identifier of the language. See here for a complete list of supported languages.
-
09-01 English (United States).cfgis an empty language file and can be used as template. Copy this file to your new language file. See the previous section for more details about the file naming. - Start HLSW. If the file naming is correct your language should be listed at Settings -> Settings... -> Misc -> Language.
- Now you can start translating all english text in your new language file. Simple replace all
undefpatterns by your translated string. Don't change anything else in the file. You can start translating the main menu (['Menu'] -> ['IDR_MAINFRAME']) to see if everything is working. It is important that you restart HLSW that you changes take affect.
Translation Guidelines
Remove undef
The goal of every translation is to replace undef by a translated string. If you decide for any string to keep the english text, replace the undef by the english text. So you can simple search the document for undef to find something to work and we can generate correct statistics how many strings are missing.
Format
All english and translated text are stored in double quoted strings ("). Within the quotes there exists a special format to write some charecters. E.g. if you like to write a " you must enter \".
\"
| "
|
\\
| \
|
\r
| Carrige return |
\n
| New line |
\t
| Tabulator |
Only modify translation strings
In the language file only modify the ['Translation']. It is set to undef if there exists no translation.
e.g.
['IDS_UNSPECIFIED'] = {
['English'] = "Unspecified";
['Translation'] = "Nicht angegeben"; // <--- Modify only the double quoted string
};
Keep special strings in translation
In the english translation are sometimes special strings embedded that must be kept in the translation (in correct order).
| Type | Description |
|---|---|
| print format | Any pattern starting with % and ending with s, d, u, x, X are printf formatations. %% is convertert to %. It is also important not to change the order. If the printf pattern are not correct HLSW could crash processing the text. Examples: |
| Tabulator and line feed | \n, \r\n, \t
|
| HLSW Tags | Upper letter enquoted in <>.e.g. |
| Shortcuts in menus | Do not change shortscuts in menus.
e.g. the english menu entry |
| & in menus | In menu strings a & in front of any character defines the shortcut key for this menu item. The character is displayed underlined. With & you can choose any character you like for the menu shortcut but you should mind that one shortcut is not used twice. "&&" is displayed as one "&". e.g. the string "&Datei" would be displayed as "Datei" and you could select it with Alt + D if the menu is focused. |
Untranslatable Strings
There are many strings in HLSW that are not in listed in the language config files and therefore cannot be translated. Please report any of these strings in article Untranslatable Strings.
