| 1 | Licq Qt4-GUI Translation Support |
|---|
| 2 | |
|---|
| 3 | Creating a New Translation File |
|---|
| 4 | =============================== |
|---|
| 5 | |
|---|
| 6 | If there is no .ts file for your language, you will need to create |
|---|
| 7 | a template first. It could be done by running "make template" in the build |
|---|
| 8 | directory. Which creates template.ts file in the po directory. |
|---|
| 9 | Then rename it in accordance to the language you are going to translate into |
|---|
| 10 | (e.g. ru.ts for Russian) and open it with Qt4 Linguist to start translating. |
|---|
| 11 | |
|---|
| 12 | Edit po/CMakeLists.txt and add ru.ts to the po_SRCS list. |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | Updating a Translation File |
|---|
| 16 | =========================== |
|---|
| 17 | |
|---|
| 18 | Text strings are updated with each new Licq release, thus it is necessary |
|---|
| 19 | to update the .ts files. This is done simply by running "make merge" in the |
|---|
| 20 | build directory. The updated .ts file can now be edited and any necessary |
|---|
| 21 | translations be added or updated. |
|---|
| 22 | |
|---|
| 23 | After several updates you will notice obsolete translations in the .ts file. |
|---|
| 24 | In order to properly remove them you can run "make clean-merge". |
|---|
| 25 | (This is advised to do after translation is done, not before.) |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | Installing a Translation File |
|---|
| 29 | ============================= |
|---|
| 30 | |
|---|
| 31 | Once the .ts file has been created and translated, it must be converted into |
|---|
| 32 | a .qm file. This is done simply by doing "make". Once you have the .qm file, |
|---|
| 33 | it must be installed with "make install". |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | Using a Translation File |
|---|
| 37 | ======================== |
|---|
| 38 | |
|---|
| 39 | Set the environment variable LC_MESSAGES to the desired language code |
|---|
| 40 | (as per GNU gettext standard) and it will be loaded next time the Licq |
|---|
| 41 | is started. |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | Notes |
|---|
| 45 | ===== |
|---|
| 46 | |
|---|
| 47 | Help on using Qt4 Linguist can be found on Trolltech documentation homepage: |
|---|
| 48 | http://doc.trolltech.com/4.3/linguist-manual.html |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | Executive Summary |
|---|
| 52 | ================= |
|---|
| 53 | |
|---|
| 54 | Note that we call the Linguist linguist-qt4 here. The name might also be |
|---|
| 55 | just linguist on your installation. Notably Debian calls it the former |
|---|
| 56 | way. |
|---|
| 57 | |
|---|
| 58 | First translation: |
|---|
| 59 | |
|---|
| 60 | licq$ mkdir build |
|---|
| 61 | licq$ cd build |
|---|
| 62 | build$ cmake .. |
|---|
| 63 | build$ make template |
|---|
| 64 | build$ cd ../po |
|---|
| 65 | po$ mv template.ts ru.ts |
|---|
| 66 | |
|---|
| 67 | Updating the translation: |
|---|
| 68 | |
|---|
| 69 | licq$ cd build |
|---|
| 70 | build$ make merge |
|---|
| 71 | build$ cd ../po |
|---|
| 72 | po$ linguist-qt4 ru.ts |
|---|
| 73 | po$ cd ../build |
|---|
| 74 | build$ make clean-merge |
|---|
| 75 | |
|---|
| 76 | Installing the translation: |
|---|
| 77 | |
|---|
| 78 | licq$ cd build |
|---|
| 79 | build$ make install |
|---|
| 80 | |
|---|
| 81 | Using the translation: |
|---|
| 82 | |
|---|
| 83 | $ LC_MESSAGES="ru" licq |
|---|