~ubuntu-touch-coreapps-drivers/trojita/git-kde

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
The localization works as follows:

1) KDE scripts set up a special environment which then runs the top-level
Message.sh script which generates the trojita_common.pot file "somewhere".

2) Translators somehow turn the trojita_common.pot file into
[some-path-in-KDE-SVN]/$LANG/[stuff]/trojita_common.po files. From Trojita's
point of view, all of that happens by pure magic.

3) When localization is about to be used, the produced .po files are downloaded
into the po/ directory and renamed to trojita_common_$LANG.po. This MUST happen
before qmake is run (or rather "qmake MUST be re-run after the contents of po/
changes). You can use the l10n-fetch-po-files.py script for that (run from the
top-level directory.)

4) The build system converts the .po files into .ts and these into .qm, which
are then ready to be used by QObject::tr. The .qm files are installed into
something like /usr/share/trojita/locale.

5) The .qm files are loaded at runtime by QTranslator, either from the
system-wide directory, or from path-to-binary/locale.

That's all, and it works!