-
Notifications
You must be signed in to change notification settings - Fork 22
UI localization
You can create translation for your language by make copy of existing file (english or other). See the information below about data structure.
Translation files located in lang dir. Each language in separate ini-file. In general filename may be any, but I recommend to use two-letter ISO 639-1 code (for example: ru.ini, en.ini, uk.ini). Used format is simple key=value. File must contains 2 sections: info
and translation
. info
contains information about this language and it`s author. translations
contains localized strings themselve. Complete file example:
[info]
LangCode=ru
LangName=Russian
LangNativeName=Русский
AlternativeFor=be,uk
Author=John Doe
[translation]
Language=Язык
OutputDirectory=Папка для сохранения
SelectOutputDirectory=Выберите папку для сохранения
OpenDirectory=Открыть папку
Fields in info
section:
-
LangCode
— ISO 639-1 language code (2 letters) (mandatory) -
LangName
— Language name in English (mandatory) -
LangNativeName
— Local language name (not mandatory, but desirable) -
AlternativeFor
— List of ISO 639-1 codes separated by comma. Program tries to use strings from this language for incomplete translations (or from English as fallback). Also it used at program first run when there is no configuration file yet and program try to get system language. If there is no localization for system language found, but it mentioned inAlternativeFor
field in any other language, alternative language will be used. (In the file example above, russian language (ru) will be used as alternative for belorussian (be) and ukrainian (uk)) (not mandatory) -
Author
— Translator(s) name, will be shown in About window (not mandatory)
Not mandatory fields may be skipped or contains empty values.
Files must be encoded in UTF-8 without BOM (up to 1.8 release Unicode was used). Line endings is CR+LF (Windows style). Quotes over values is not needed. Example:
OpenDirectory="Открыть папку" ;Wrong !!!
OpenDirectory=Открыть папку ;Good
Files may contains comments started from new line and begining with semicolon ;
. Examples:
;It is a comment
Language=Язык
OutputDirectory=Папка для сохранения
It`s allowed to use line breaks and tabs (\r
, \n
, \t
).
StringID=This is an example\r\nof multiline\r\nstring with\r\n\ttabulation
This string will looks as:
This is an example
of multiline
string with
tabulation