Use QProcess::errorString instead
[nomnom.git] / doc / HowtoTranslate.txt
blob21bbbdfe05064056789461b0738387720d25f009
2 HOWTO: Translate NomNom
3 =======================
5 Prerequisites
6 -------------
8 Make sure you have installed Qt development libraries with with the Qt
9 tools (e.g. qmake, linguist, lupdate and lrelease). See the INSTALL file
10 in the nomnom top source directory for the other prerequisites that nomnom
11 depends on.
13 Before you get started
14 ----------------------
16 Get the latest version of nomnom from:
17   http://nomnom.sourceforge.net/
19 Please *do not* use the development code from nomnom git repository as
20 it is subject to frequent changes.
22   tar xf nomnom-$release.tar.* ; cd nomnom-$release
23   mkdir tmp ; cd tmp
24   ../configure ; make
26 The translation subsystem of nomnom supports the following environment
27 settings:
29  * N_QM_SHOW_SCANDIR ;# display the scanned (for .qm files) dirs
30  * N_QM_SHOW         ;# display the found .qm files
32  Example: env N_QM_SHOW_SCANDIR=1 N_QM_SHOW=1 ./src/nomnom
34 The subsystem picks the system locale setting and tries to match it to
35 one of the found .qm files. If one is found, the .qm is loaded.
37 The default language (English) is built-in and is does not have a
38 string to identify it. If nothing was matched to the existing .qm files,
39 the subsystem defaults to English.
41 Please note that some elements of nomnom cannot be translated as they
42 are part of the core system of Qt. Examples of this are the standard
43 buttons seen in many of the dialogs. Make sure you have installed the Qt
44 library translations along with the rest of the Qt and that your system
45 locale is set to the appropriate value, e.g.:
47   env LANG=de_DE.UTF-8 ./src/nomnom
49 Untranslatable strings
50 ----------------------
52   * GPLv3+ license found in About / License
53     These are the contents of the COPYING file
56 Creating a new .ts file
57 =======================
59 The translations exist in .ts files, you can read more about them here:
60   http://doc.qt.nokia.com/latest/internationalization.html
62 We will use a wrapper script ("gen-tr.sh") to handle the .ts files in the
63 following examples. If you are interested, have a look at the script for
64 the essentials.
66 Getting started
67 ---------------
69 Let's assume you are going to create the French translation for nomnom.
70 These examples assume that you have created the 'tmp' VPATH as described
71 in the "Before you get started" above.
73   cd nomnom-$release                    ;# cd to the top source dir
74   ./gen-tr.sh -n tr/NomNom_fr_FR.ts     ;# create the French .ts
75   linguist tr/NomNom_fr_FR.ts           ;# translate using linguist
77 Once you have gone over all of the translatable strings, exit linguist
78 and run:
80   cd tmp                                ;# cd to 'tmp' dir
81   ../gen-tr.sh -r ../tr/NomNom_fr_FR.ts ;# produce .qm file
82   cp ../tr/NomNom_fr_FR.qm tr/          ;# cp .qm to $top_srcdir/tmp/tr/
83   env LANG=fr_FR.UTF-8 ./src/nomnom     ;# assumes "language=" in config
85 Note that the last step does not have to include the LANG setting.
87 It is possible to use the linguist application (File / Release) for the
88 same effect that of running "gen-tr.sh -r".
90 You should be able to choose the language from the dialog (Preferences /
91 Options / Language) and make it this way a permanent setting in the
92 config file.
94 You can find the path to the config file in the same dialog page
95 (Preferences / Options) if you're not sure where it is located.
98 Updating an existing translation
99 ================================
101 The steps are very similar to the ones above. Let's assume you have
102 noticed that the existing French translation is missing some of the
103 new strings introduced in a later version of nomnom.
105   cd nomnom-$release                ;# cd to top source dir
106   ./gen-tr.sh -u                    ;# this updates all existing .ts files
107   linguist tr/NomNom_fr_FR.ts       ;# edit the update .ts
108   mkdir tmp ; cd tmp                ;# cd to 'tmp' dir
109   ../configure ; make               ;# build nomnom
110   ./src/nomnom
112 The "make" produces the updated .qm file initially. If you, however,
113 edit the ../tr/NomNom_fr_FR.ts file after this, you have to:
115   (edit ../tr/NomNom_fr_FR.ts)
116   ../gen-tr.sh -r ../tr/NomNom_fr_FR.ts ;# produce .qm file
117   cp ../tr/NomNom_fr_FR.qm tr/          ;# cp .qm to $top_srcdir/tmp/tr/
119 This is because the current Makefiles do not track the .ts files for
120 changes.
122 Once you have (re)generated the .qm, you can:
124   env LANG=fr_FR.UTF-8 ./src/nomnom     ;# assumes "language=" in config
126 See the notes above about LANG and choosing the language from the
127 dialog.
130 Contributing .ts to the project
131 ===============================
133 If you would like to contribute your .ts (new or updated) to the project,
134 please open a new ticket at:
135   http://sourceforge.net/apps/trac/nomnom ;# you will need sf account
137 We can then add the .ts to the nomnom dist. Thanks!