Menu

How to translate

Nick Korotysh

Worth to notice, translation process is done through transifex.com, thus you must have an its account to continue. Also you must join a translators team for my project. This is pretty simple: just click link above, login into transifex and click "Help to translate Digital Clock 4" button. Next you will find button like "Join project" (can't remember exact title), simple click it and follow instructions.

After joining a team, you may note that there are a lot of files to translate... Don't worry, just only one of them contains pretty much strings, almost any other file has only few lines to translate.

There are 2 options how to translate the project. I highly recommend the second one, but in some cases first will be useful too and much easy.

Option 1

Use transifex.com web interface to translate strings. Advantages of this method is obvious: nothing required to install to edit translations. But in other hand there is a big disadvantage: you see just strings, no any context in which it used. Therefore I recommended to use this ability only for editing(correcting) existing translations.

Option 2

Translate files locally using Qt Linguist. This is recommended option. To do this you will need next tools installed to your PC:

Qt toolkit is required because it contains essential tools to work with translation files (my clock is written using Qt). Any minimal setup is enough. If you not familiar with Qt installation process, follow appropriate part of any of next guides (depending on your OS) to complete this step.
Windows, Linux, macOS.

tx client is convenient tool to communicate with transifex.com, see quick guide for details. Read and understand this manual is not required, this is just for your information, required stuff will be described below.

mercurial (or TortoiseHg, it already includes mercurial) is required to access sources. It may be useful if you plan to update translations regularly as code updates. In any case, you can download source code as archive (that's why I noted this optional).

Translation process

Through this section next agreements will be used:

  • sources path: ~/tmp/clock_src
  • Qt path (also QT_ROOT): ~/Qt/5.8/clang_64

Remember to replace them when you will run any commands listed below. Ok, let's start.

First of all, you need to get source code. You can do this in to 3 ways: use mercurial to clone repository, download snapshot (easy and good choice), download latest source tarball (not recommended).

Next step you must complete: generate English (source) translations. To do this, open terminal and navigate to folder with downloaded sources:

Don't forget to replace my paths with yours. Lines below are just an example!

cd ~/tmp/clock_src

and then issue the command:

~/Qt/5.8/clang_64/bin/lupdate -no-obsolete DigitalClock.pro

This will print a lot of output and generate a lot of "*_en.ts" files. These files you are interested in.

Next rename en suffix of each file to correspond language what you want to translate into (consider de, this will mean you are translating into German). Everything that left is to open all these files in Qt Linguist (you can find it in bin folder of you Qt installation) and translate them. Don't worry if you run this tool first time. Qt Linguist is pretty simple to understand how to work with it even without reading any documentation. But if you want to familiarize yourself with it, there is good description from Qt developers.

When you finished translation process, you must to push your changes (new or edited *.ts files) to transifex. There is time for tx tool. Just run in terminal from source folder:

tx push -t

That's all. Don't hesitate to contact me if you have any troubles. Contact information can be found in 'About' dialog. Happy translating!


Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.