Skip to content

Translation example

Sébastien Gallou edited this page Feb 11, 2016 · 3 revisions

As said here, every Yadoms modules containing displayable messages, has a locales folder and inside it, a text file per supported language (en.json for English, fr.json for French, etc...). This text file contains the list of displayable labels for a given language. Yadoms modules are : Yadoms web client, script interpreters, plugins and widgets.

#Let's go for adding language The example aims to add German support for the Yadoms web client (the graphical user interface to use and configure Yadoms) : First open an file explorer, go to your Yadoms executable folder, and enter to the web client locales folder (www/locales). Here under Windows :

Step 1

Now copy the en.json file, an rename it using the language ISO code (2-letters code, see ISO 639-1 column in this link) to make Yadoms find it. Here, for German, the code is de.

Step 2

Step 3

Now open the copied file, with a simple text editor, we recommend Notepad++ :

Step 4

This file is in JSON format, composed of pairs of keys (used by Yadoms to retrieve labels) and value. You just have to change the values into your language (don't change the keys, or Yadoms will not be able to retrieve the labels). What you have to change is highlighted in green here :

Step 5

Once done (sorry for the ugly translation...) :

Step 6

You can check that JSON format is still valid copying all the file content and pasting on this JSON validator :

Step 7

Once it's OK, save the file.

We now have to declare to Yadoms that German is now supported :

TODO

Check the translation

TOTO (expliquer l'utilisation de l'outil de vérification)

Reload the web client (F5 on your internet browser) to see the result (Depending on the language of your system, it should be necessary to select the German language in the Yadoms dashboard).

#Modules to translate

If you want to add a full support of your language, you have to do the same for these modules :

  • web client : folder www/locales
  • all plugins : folders plugins/{The plugin name}/locales
  • all widgets : folders www/widgets/{The plugin name}/locales

#How to publish your translation

Some others users are probably interested by your translation, so we encourage you to publish it :

  • The better way for us is that you post a pull-request on Github
  • If you are not aware of what is a pull-request, simply send all your new JSON files on the forum.

Clone this wiki locally