Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add content
Section
Column
width60%

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.

...

Column
width40%
Panel
titleIn this page
Table of Contents

...

Add a new language

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

Column
width400px
Code Block
languagetext
LANGUAGES = fr zh_CN de # es ru

Then use this commands 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.

Column
width400px
Code Block
languagebash
themeEmacs
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 

Column
width400px
Code Block
languagebash
themeEmacs
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"):

Column
width400px
Code Block
languagebash
themeEmacs
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.
Ffor first time you should made a commit including the translation.pro and gcs_de.ts file.

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

Column
width600px
Code Block
languagebash
themeEmacs
make gcs cd
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
qmake -o Makefile translations.pro make ts linguist gcs_de.ts
/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 made a commit with the two needed files:

Column
width800px
Code Block
languagebash
themeEmacs
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 made 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.