Skip to content

Translating Yadoms

Jean-Michel DECORET edited this page Jan 19, 2016 · 5 revisions

Your language is not actually suported by Yadoms ? No problem, Yadoms was written as everyone can add new language (without writting code).

Yadoms is modular : the core is a module, each plugin is a module, each widget, etc...

Module translation

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.

Add new language to a module

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"
      }
   }
}

Check your translations

Json format

To check that your file is well syntaxed, you can use this pretty tool : http://jsonlint.com/

i18n-check

To check that your translation is up-to-date (no missing label, no obsolete label, etc...), you can use the tool i18n-check, developped for Yadoms, available in {Yadoms_source_code}/ideTools/i18n-check/i18n-check/bin/Release. It's a Windows only tool.

Clone this wiki locally