Program and modules translation

Common information

To create a translation you need Qt utils: linguist - for translation; lupdate - for .ts file updating and synchronsation with the source code, lrelease - for compilation into .qm file, which is used by program, and qmake - for .pro file creation, if it doesn't exist.

Well, for translation you need: Qt,Qt-dev >= 4.4

Translation files placement

Your qutIM configuration folder is `~/.config/qutim`. There you have (or should create) a folder for translations: `~/.config/qutim/languages`. There should be a separate folder for each language, e.g.: `/.config/qutim/languages/ru`. In that folder .qm files are placed.

Filenames

It's better to name files in the following way: `core` - for qutim core, and other names - are the names of the corresponding plugins, e.g.: icq.ts, jabber.ts etc.

Old core revisions (before 215) didn't support multiple files and could load only `main.qm` which should consist the translation of all the modules.

How to create a .pro file and how to add file for update

Well, for translation you need .pro file. If you haven't one, it can be created by the command:

qmake -project

Attention! This .pro file is useless for compilation, it's used only for translation!


To start a translation you should point translation file in the .pro file, i.e. add translation filename to the TRANSLATIONS section. If you haven't that section, you can create it, e.g.:

TRANSLATIONS += qutim_core.ts

Now you should create this file or update it with the translation update command.

How to update translation

To update translation file .ts you should execute:

lupdate ./file.pro

This will update and/or create files for translation. To create file useful for the program, execute the command:

lrelease ./file.pro

Also you can use `release` command from the Qt linguist.

How to do a translation

To do a translation, you should run linguist, from the terminal it can be run by command:

linguist ./file_to_translate.ts

Or you can run it from your DE menu, and choose .ts file in the linguist.

Translation is done in user-friendly program so you'll mustn't have any problems with it. Don't forget about Save and Release in File menu. And you should update your .ts file after each source change.

/home/qutim/data/www/wiki.qutim.org/data/pages/en/how_to_translate.txt · Last modified: 2009/12/19 02:00 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki