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.
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.
sudo apt-get install qt4-linguist-tools
~$ linguist
Translation tools (Qt Linguist, lupdate) are now included in qttools5-dev-tools package.
sudo apt-get install qttools5-dev-tools
~$ linguist
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.
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:
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.
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.