Adding Languages
Use the Entity Translation Editor to add or edit language translations for entities used in MQTT, API and system operations. It shows every entity and its translations in a table, highlights missing translations, and lets you save your changes straight back to the file. Commit back to the GitHub repository when done.
Use the WebUI Translation Editor to edit the translations of the WebUI itself. Download the i18n folder from here. All languages are shown side by side in one table, with checks for empty translations. Make the changes, save and commit back to the GitHub repository.
The explanations of fault codes have their own page and editor: see Adding Fault Codes.
Adding Manually
How to add language XY to the WebUI
- Download the SVG flag from here and place in
interface/src/i18n - Create the folder XY in
interface/src/i18n - Copy
interface/src/i18n/en/index.tstointerface/src/i18n/XY/index.ts - Change in the first and last line
ento your language and in the first linesBaseTranslationtoTranslation - Edit
interface/src/i18n/XY/index.tsand replace the English texts by your language - Edit
interface/src/components/layout/LanguageSelector.tsxand add the following:
import { ReactComponent as XYflag } from 'i18n/XY.svg';
...
<MenuItem key="xy" value="xy">
<XYflag style={{ width: 16, verticalAlign: 'middle' }} />
XY
</MenuItem>
- Navigate to the
interfacefolder and typepnpm standaloneand test the WebUI
How to add language XY to device entities
-
Edit
interface/src/project/SettingsApplication.tsxand insert in selection box (~ line 345):<MenuItem value="xy">NewLanguage (XY)</MenuItem> -
Edit
src/system.cppline 45 and appendEMSESP_LOCALE_XYto thelanguages[]array -
Edit
src/local_translations.hand append the defines by adding
#define EMSESP_LOCALE_XY "xy" -
add your translation as
, "your text"at the end of eachMAKE_PSTR_LIST()inside the bracket it should look something like this:MAKE_PSTR_LIST(tag, "en", "de", "nl", "se", "pl", "xy") -
Compile, flash, test