-
-
Notifications
You must be signed in to change notification settings - Fork 17
Translating Yadoms
Your language is not actually supported by Yadoms ? No problem, Yadoms was written as everyone can add new language (without writing code).
Yadoms is modular : the core is a module, each plugin is a module, each widget, etc...
Below is explained how to do, additionally you can find a full detailed example here.
For each module, the internationalization (also called i18n) resides in a "locales" folder. In this folder, we can find the reference file "en.json", which contains all labels in English.
To add a new language, simply copy the en.json file, and rename it with the ISO2 language code, (ex : fr.json for French). Open this new file, it's in the JSON format, containing pairs of key/value. Replace the values (don't change keys !) with the translated label.
en.json :
{
"name": "Example",
"description": "This is a translation example",
"configurationSchema":
{
"Serial Port":
{
"name": "Serial port",
"description": "The serial port used to connect your peripheral"
}
}
}
fr.json :
{
"name": "Exemple",
"description": "Ceci est un exemple de traduction",
"configurationSchema":
{
"Serial Port":
{
"name": "Port série",
"description": "Le port série à utiliser pour connecter votre périphérique"
}
}
}
To check that your file is well syntaxed, you can use this pretty tool : http://jsonlint.com/
To check that your translation is up-to-date (no missing label, no obsolete label, etc...), you can use the tool i18n-check, developed for Yadoms, available in {Yadoms_source_code}/ideTools/i18n-check/i18n-check/bin/Release. It's a Windows only tool.
Yadoms -- The ultimate house automation solution