Localization (l10n)
Work in progress
If you want to translate ConEmu interface to your language, your localization efforts would be appreciated.
- Where language resources are stored
- Resource file format
- How to add new language
- Resources deprecation
- How to test
Where language resources are stored
All language resources are located in the file /Release/ConEmu/ConEmu.l10n. Don’t forget to checkout latest daily branch if you work with local sources.
Resource file format
The format of the JSON file is simple and was designed to easify patches.
The file consists of several sections: languages
for list of languages;
cmdhints
, mnuhints
and controls
for resources themselves.
The resource may be either simple “string”, or an [“array “, “of “, “strings”] which are concatenated without changes at run time.
{
"languages": [
{"id": "en", "name": "English" }
]
,
"cmnhints": {
"bResetSettings": {
"en": "Reset all settings to defaults",
"id": 1595 }
,
"cbAnsiLog": {
"en": [ "Log console output to text files\r\n"
, "ConEmu-YYYY-MM-DD-pNNNN.log\r\n" ],
"id": 2679 }
}
}
How to add new language
- Add to the
languages
new record. Example below adds Russian with idru
. - Translate all entries by adding
ru
record to each resource.
--- a/Release/ConEmu/ConEmu.l10n
+++ b/Release/ConEmu/ConEmu.l10n
@@ -1,5 +1,7 @@
{
"languages": [
{"id": "en", "name": "English" }
+ ,
+ {"id": "ru", "name": "Русский" }
]
,
@@ -842,6 +848,7 @@
,
"tFontFace": {
"en": "Face name for main font",
+ "ru": "Имя основного шрифта консоли",
"id": 1511 }
,
"tFontFace2": {
Resources deprecation
If the en
resource is changed, other languages translations become deprecated.
To depict that, language id-s for this resource would be prefixed with _
(ru
-> _ru
).
So, translation maintainers may easily find changed resources.
{
"bResetSettings": {
"en": "Reset all settings to defaults",
"_ru": "Сбросить настройки к умолчаниям",
"id": 1595 }
}
How to test
The work is still in progress… At the moment only hints and Settings dialog controls are processed by l10n engine.
To check the translation:
- Download and install actual build.
- Place the file ConEmu.l10n
into
%ConEmuBaseDir%
and runConEmu.exe
with your language code.
ConEmu.exe -lng "ru"
Alternatively, you may specify the location of the file with -lngfile
argument.
ConEmu.exe -lng "ru" -lngfile "full-path-to-l10n"
Also, the button Reload...
in the Settings dialog would reload language data too,
and resources will be applied to dialog controls when you open the dialog next time.