Skip to content

How to contribute

Thomas Piller edited this page Dec 15, 2022 · 11 revisions

Translation

MapX can be translated very easily. To do so, you will have to fork this project, edit the JSON files in /app/src/data/dict*.json, and make a pull request. If the changes are well formatted, they will be integrated to MapX.

Structure of dict files

The dict_* JSON structure is quite simple:

[
  {
    "id": "key",
    "en": "Corresponding value in english",
    "fr": "Valeur correspondante en français"
  },
  {
    "id": "another_key",
    "en": "Sentence that contain <value that will be replaced> or %1$s, another value that will be replaced",
    "fr": "Une phrase qui contient <une valeur qui va être remplacée> or %1$s, une autre valeur qui sera remplacée"
  }
]

Any value can be edited, but special character like new line (\n), value like %1$s and code like <value> have to be preserved and handled carefully. If the character is escaped (e.g. \\n), the translation should contain exactly the same format.

Example: Hello %1$s. \\n Your email is <email> should be translated in french by Bonjour %1$s. \\n Votre email est <email>. This will render as:

Hello John.
Your email is [email protected]

Be aware that plural are defined by an s at the end of the translation key: views means that there are more than one view. So the translation should reflect this: Views, Vues, Vistas will be the correct translation of the key views.

How to edit

  • Using github, you just have to press the edit button, in your forked project. Quite simple.
  • Using a text editor. Less simple, as you will have to fetch a version of MapX source code on your computer.

In any case, if you plan to make multiple edits or plan to stay up to date with other changes in MapX source code, you will have to maintain a version of MapX on your computer. This is well explained here.

⚠ Warnings

  • Do not use Microsoft Word, Apple Pages, OpenOffice, LibreOffice: those are not text editors, but word processors. If you edit any MapX source code file with a word processor, it may explode.
  • Do not enter any quotation mark.
  • Translate every sentence with something of similar length (to fit it in its given case in the app).
  • Don't change the "id" value of any word.
  • Don't change the code and special characters used in a translation.
Clone this wiki locally