~aleteoryx/muditaos

ref: 32ead4a0514943df62c10c77c4e6a3a8f69b8221 muditaos/doc/i18n.md -rw-r--r-- 2.9 KiB
32ead4a0 — Michał Kamoń [EGD-4374] meditation: fix default counter settings (#1099) 5 years ago

#Internationalization

#File and data structure

#Display language

Currently all the wording used in MuditaOS interface is collected in the form of JSON files which are located in the image/assets/lang folder.

The default fallback file for every language is currently the English version - English.json.

Language file naming pattern should be universal because MuditaOS displays languages based on the file name (without extension) eg. Deutsch.json will be displayed in language settings as Deutsch.

The name of a language file should also be in the language of the created file eg. for English it should be English.json, for Polish Polski.json etc.

The structure of the file is typical for JSON files:

(...)
"common_open": "OPEN",
"common_call": "CALL",
"common_save": "SAVE",
"common_send": "SEND",
(...)

The keys on the left side refer to the values on the right side. These values are later displayed in MuditaOS applications.

#Keyboard input language

The first four values of JSON language files tell MuditaOS, which keyboard input language is the specific language setting using:

"common_kbd_lower": "lang_eng_lower",
"common_kbd_upper": "lang_eng_upper",
"common_kbd_numeric": "numeric",
"common_kbd_phone": "phone",
(...)

These values are names of KPROF files, which are located in the image/assets/profiles folder.

Every language has its own files for upper and lower letters. Here's an example of a working implementation of buttons 2 and 3 in the lang_eng_lower file:

(...)
#NumericKey2 = 32,
32
true
'a','b','c'
0,0,0
#NumericKey3 = 33,
33
true
'd','e','f'
0,0,0
(...)

Values explanation:

  • The first value is the number of the button (31 means button "1", 32 means button "2" etc.)
  • The second value is true if the key is cyclic or false otherwise
  • The third line is a list of values that would be available by clicking this button
  • The last line includes zeros written as many times as there are characters available under the button

#Date and time

MuditaOS follows Linux date to format date and time.

#How to start localizing the interface

  1. Create an issue with the localization you want to start working on. Please use the following scheme: [Language] localization [emoji_flag] eg. Polish localization 🇵🇱. The emoji flag is a small detail that can help other community members in finding the localization they're interested in and helping you out in implementing it. Please make sure that the localization you want to implement has not been already implemented.
  2. Add a i18n label to your new issue on GitHub.
  3. Follow the "Contributing to MuditaOS" article.
  4. As soon as you create a Pull Request with your localization we will review it and add it to the official MuditaOS distribution.