Generate template files

Use the script npm run template to generate up to date template files for all packs

Note

This is only necessary if you add new entries that are not yet in the template file. If not the case you can skip this step and generate a new language pack

It will generate master file in languages directory : master_translations.json and split used translations subdirectories : cncgrblpack, cncgrblhalpack, printerpack, sandtablepack

Currently:

  • CNC GRBL in languages/cncgrblpack
  • CNC grblHAL languages/cncgrblhalpack
  • 3D Printers (all) languages/printerpack
  • Sand Table (all) languages/sandtablepack

Generate language pack files

The list of currently supported languages is in src/components/Translations/languages.json, if new language is added, please add it to the list doing a PR or opening an issue.

Language Name Code file name
French Français fr lang-fr.json
German Deutsch de lang-de.json
Hungarian Magyar hu lang-hu.json
Indonesian Bahasa Indonesia id lang-id.json
Italian Italiano it lang-it.json
Spanish Español es lang-es.json
Polish Polski pl lang-pl.json
Russian Русский ru lang-ru.json
Ukrainian Українська uk lang-uk.json
Portuguese-Br Português ptbr lang-ptbr.json
Turkish Türkçe tr lang-tr.json
Thai ไทย th lang-th.json
Korean 한국어 ko lang-ko.json
Chinese (simplified) 简体中文 zhcn lang-zhcn.json
Chinese (traditional) 繁體中文 zhtw lang-zhtw.json
Japanese 日本語 ja lang-ja.json

To generate a language pack file, you need to:

  • Use existing reference file, or if it is new language, rename a copy of the template file according the language code http://www.lingoes.net/en/translator/langcode.htm removing - if any, and add lang- in from of name. so for example :

    • for french language pack, master_translations.json file should be renamed to lang-fr.json
    • for simplified chinese language pack, master_translations.json file should be renamed to lang-zhcn.json
  • Modify the language pack file according to the language you want to create or update

  • Build the final packs using the following command to compress the final pack targeting the file :

    npm run buildlangpack lang-<target language>.json

    for example :

    npm run buildlangpack lang-fr.json

    This will generate a non compressed and a compressed file in each subdirectory of languageS directory according to the systeme:

    • languages/cncgrblpack/lang-fr.json
    • languages/cncgrblpack/lang-fr.json.gz
    • languages/cncgrblhalpack/lang-fr.json
    • languages/cncgrblhalpack/lang-fr.json.gz
    • languages/printerpack/lang-fr.json
    • languages/printerpack/lang-fr.json.gz
    • languages/sandtablepack/lang-fr.json
    • languages/sandtablepack/lang-fr.json.gz

You can then use the compressed file in the WebUI or the non compressed file to test the language pack with the test server of WebUI

Compare template pack with language pack file

If you have a doubt about missing entries or extra entries, you can use the following script to compare current language pack content against the template language pack to see if the language pack need to be updated.

npm run check reference=<template path file> target=<not compressed language pack>

npm run check target=languages/printerpack/lang-fr.json reference=languages/printerpack/en.json

> ESP3D-WEBUI@3.0.0 check
> node ./config/checkpack.js "target=languages/printerpack/lang-fr.json" "reference=languages/printerpack/en.json"

Comparing files

Checking extra entries...
S724 : Fermer l'application
...done, found  1 extra entries

Checking missing entries...
S14 : Settings
S24 : Close
...done, found  2 missing entries

Comparaison done

Propose / update language pack files

Please do a PR to webUI 3.0 github branch or submit ticket with at least the reference file, a complete PR include also generated compressed and clear version of the language pack files for each target using the script npm run buildlangpack lang-<target language>.json