When editing CSV files with VSCode, the extension Edit CSV is recommended.
Windows requires you to have Python and Git installed and within your $PATH
For Linux, most distributions come with python
and git
by default and macOS comes bundled with python
, but to use git
you either need to install the Command Line tools via xcode-select –-install
, or download Git separately.
- Clone this repository
git clone https://github.com/solosky/pixl.js.git; cd pixl.js
- Edit
fw/data/i18n.csv
- Run
py.exe fw/scripts/i18n_gen.py
to generate new language files. - Optional: Run
py.exe fw/scripts/font_data_gen.py
to generate new font data if you add new characters ini18n.csv
- Build the Firmware
- Clone this repository
git clone https://github.com/solosky/pixl.js.git; cd pixl.js
- Edit
fw/data/i18n.csv
- Run
python3 fw/scripts/i18n_gen.py
to generate new language files. - Optional: Run
python fw/scripts/font_data_gen.py
to generate new font data if you add new characters ini18n.csv
- Build the Firmware
The process is similar to updating an existing translation, and has the same requirements depending on your Operating System.
- Add new column in
fw/data/i18n.csv
, for example "ja_JP" - Run
fw/scripts/i18n_gen.py
to generate new language files. - Optional: Run
fw/scripts/font_data_gen.py
to generate new font data if you add new characters ini18n.csv
- Edit
fw/application/src/i18n/language.h
andfw/application/src/i18n/language.c
to adopt new language - Edit Makefile to include
$(PROJ_DIR)/i18n/ja_JP.c
as C source files - Build the Firmware
For release builds (RELEASE=1), the firmware uses wenquanyi_9pt_u8g2.bdf to display unicode characters.
Please check if the new language character codepoint is included in wenquanyi_9pt_u8g2.bdf or not.
If not, it's not recommended supporting the new language due to the MCU internal flash restrictions.
The language file can be found under `web/src/i18n'
In this example, we will add a Japanese (ja_JP) translation:
-
Copy the
en_US.js
file and name itja_JP.js
-
Translate the string within
ja_JP.js
including thechangeok
message.Don't translate the other language names.
Add your language at the bottom of the
lang {
section:ja: '日本語',
-
Edit
web/src/i18n/index.js
while keeping its current structure, adding:import elementJaLocale from 'element-ui/lib/locale/lang/ja' // element-ui lang import jaLocale from './ja_JP' elementJpLocale
And extending
messages
:ja_JP: { ...jaLocale, ...elementJaLocale, },
-
Add your language to the other
.js
files (within thelang: {
section):vueja: '日本語',
-
Add your language to the
web/src/App.vue
file:
<el-dropdown-item Enabled="language==='ja'" command="ja" divided>
{{ $t('lang.ja') }}
</el-dropdown-item>