To provide a translation:
- Add an entry to
l10n/languages.txtof the formlanguage CODE - Add a localization file
l10n/lang-CODE.json
... where CODE is the language code (e.g. eo is Esperanto)
The localization file must be a valid JSON file with the following structure:
{
"page": { ... },
"interpreter": { ... },
"graphics": { ... }
}Optional: include for RTL languages (Arabic, Hebrew, etc)
"dir": "rtl"Optional: include if you want a custom set of examples, e.g. with translated keywords:
"examples": "l10n/examples.eo.txt"Page elements with data-l10n-id attributes can have text replaced.
- key: data-l10n-id or data-l10n-id
.attribute - value: replacement text
If a translation is not found, the element text will not be translated.
"translations": {
"title": "...",
...
}Alerts and other prompts show messages.
- key: the untranslated (English) string
- value: translated string
If a translation is not found, the message text will not be translated.
"messages": {
"Clear history: Are you sure?": "...",
...
}These can be found in err("...") strings in the code.
- key: the untranslated (English) string
- value: translated string
Parts of the string in {...} are substitutions and must be left alone.
If a translation is not found or is null, the English text will be used.
"messages": {
"Array size must be positive integer": "...",
...
}Keywords are special words in the Logo language which are not procedures.
There are only two - ELSE and END.
- key: the keyword alias
- value: the untranslated (English) keyword
These function as aliases when parsing programs.
"keywords": {
"...": "END",
"...": "ELSE"
}- key: the procedure alias
- value: the untranslated (English) procedure name
The aliases are added to the environment.
"procedures": {
"...": "abs",
...
}- key: the color alias
- value: a CSS color string
"colors": {
"...": "black",
...
}