Translating GCS

This page describes how to translate the strings in GCS for a new language.

To translate LibrePilot, the best way is set up first a build as described in the wiki.
If you plan to push the translation work using git and making a PR the best way is made a fork from the start. See Git Workflow.


Before starting, contact a developer via the forum to ask if someone is already working on a specific translation and avoid duplicate work.

In this page

Add a new language

You should edit the ground/gcs/src/share/translations/translations.pro file, locate the language list and add your language:

LANGUAGES = fr zh_CN de # es ru

In this example, the Spanish (es) and Russian (ru) languages are commented out and 'de' is added to the list.


Generate Makefile

At this point the German language is added, now you need to generate the Makefile using qmake.
This is needed the first time you setup a translation environment.

make gcs
cd ground/gcs/src/share/translations
qmake -o Makefile translations.pro

Generate ts file

This step is needed the first time and every time the sources are updated, this command scan all the sources and update the ts file eg. gcs_de.ts 

cd ground/gcs/src/share/translations
make ts

Start translation

From the same directory, use this command to fire up Qt Linguist (example for "de"):

cd ground/gcs/src/share/translations
linguist gcs_de.ts

Information about QT Linguist can be found here: http://doc.qt.io/qt-5/linguist-translators.html


Push the translations

Using forum

After some work the gcs_de.ts file can be packed and posted in forum.

Using git

This method is preferred for regular updates.
For first time you should make a commit including the translation.pro and gcs_de.ts file.

Changes already done in your translation branch can be displayed using 'git status':

git status
On branch LP-XXX_DE_translations
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   ground/gcs/src/share/translations/gcs_de.ts
    modified:   ground/gcs/src/share/translations/gcs_fr.ts
    modified:   ground/gcs/src/share/translations/gcs_zh_CN.ts
    modified:   ground/gcs/src/share/translations/translations.pro

Untracked files:
  (use "git add <file>..." to include in what will be committed)

no changes added to commit (use "git add" and/or "git commit -a")

And make a commit with the two needed files:

git add ground/gcs/src/share/translations/gcs_de.ts ground/gcs/src/share/translations/translations.pro
git commit

Take a look at Git Workflow for how to made a JIRA and tag branch and commit with the LP-XXX tag and finally make a pull request



Whatever the method you choose to push the work, don't be afraid and ask for help in forum.

The main part of the work is the translation itself and finally made users happy with a translated GCS.