User Tools

Site Tools


en:translation

Translation

FreeHealth can be translated easily in any language. Translators can use the Qt Linguist tool to translate text in applications. No computer knowledge beyond the ability to start a program and use a text editor or word processor is required. Download and install it.

Even if you don't write code, you'll have to get the full source code. Download source code as a zip archive: master.zip or

git clone https://github.com/FreeHealth/freehealth.git

or, if you have an account on GitHub, fork our repository.

Download Qt Linguist

Even though our apps are developed with Qt5, updating the translation files with updatetranslation.sh script requires the use of Qt4.8 dev tools. If you need to update the .ts files, use Qt4.8, but if you just need to use Qt Linguist to translate, you can use either Qt 4.8 or Qt5.

Ubuntu, Debian

Qt 4.8

  1. Install qt4-linguist-tools
    sudo apt-get install qt4-linguist-tools
  2. Type linguist in a terminal to start Qt Linguist
    ~$ linguist

Qt 5

Translation tools (Qt Linguist, lupdate) are now included in qttools5-dev-tools package.

  1. Install qttools5-dev-tools
    sudo apt-get install qttools5-dev-tools
  2. Type linguist in a terminal to start Qt Linguist
    ~$ linguist

Windows

Mac OS X

Synchronizing translation strings

If you just want to translate, don't waist your time with this! Download the zip archive translation-source-files-FreeHealth-X.X.X.zip containing all .ts files on GitHub. If the archive version is outdated, contact us (mailing list, forum or @freehealthio on Twitter), we will update the .ts files for you. To start translating, you only need Qt Linguist! Thanks.
The script will only work with Qt4.8 version of lupdate. The script will not update .ts files if you use Qt5 version of lupdate. We are working on a fix.

From time to time the translations and the original source have to get synchronized. We provide a script in the source root directory that does that for you. This should always be the first step when you start your work.

Assuming you are in the FreeHealth directory and in the master branch:

# pull in new changes 
git pull
      
# create a new working branch for your translation.
# it is generally a good idea to NOT work inside the master branch, even locally.
# This is only necessary the first time - after that you can just
# do a "git checkout MyNewTranslation" to switch to that branch.
git checkout -b MyNewTranslation --track master

# run our translation update script to sync translations with code 
./updatetranslations.sh

# now save the new translations
git add global_resources/translations 
git commit -m "translation sync"

Now all new translatable string in the code have a corresponding part in the translation files and can be translated.

Translation

If you have everything in place, you can start translating. Start Qt Linguist, and open any *.ts file in your language in global_resources/translations. The files are named <Plugin>_<LanguageCode>.ts, e.g. calendar_de.ts. You now can click through all strings and provide a proper translation in your language. Here are some guidelines that you should follow:

  • Use a vocabulary that a medical professional would understand. Don't use IT technical expressions
  • Try to avoid abbreviations
  • Use the same punctuation as in the source, whenever possible
  • If you find a spelling error in the original source, don't translate it quietly! File a bug report so that the typo can get corrected, or correct it yourself in the source.
  • Use the polite form (Sie[De], Vous[Fr], …) - and not the informal language (Du[De], Tu[Fr],…)
  • Don't translate word-by-word, try to express the (exact!) meaning of the original sentence

Saving changes

When you're done, save your changes and quit QtLinguist. After checking that only the right files were modified, commit your changes:

git add global_resources/translations/<YourChangedFiles>

Now double check that you only added your personally changed files and nothing else to the commit:

git status

Only the files you just translated should show up in the staged list.

git commit -m "added some German translation"

Now push your changes to the central server:

git push

Then create a pull request.

If you don't want to use git, just email us the translated files or upload them on the forum or the wiki.

Adding a new language

This is a bit more work. To make translations known to Qt/FreeHealth, the translation files must be included in all project files. So best thing to start is: search for all .pro files that contain a line like:

TRANSLATIONS += $${SOURCES_TRANSLATIONS_PATH}/<pluginname>_fr.ts

On Linux, you can easily do this by:

find -name "*.pro" | xargs grep TRANSLATIONS -L

Add a new line for your language, e.g. agendaplugin_ru.ts for Russian. Now you can proceed with translating, as described above.

en/translation.txt · Last modified: 2016/08/27 11:57 by Jérôme Pinguet