2 HOWTO: Translate NomNom
3 =======================
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
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
26 The translation subsystem of nomnom supports the following environment
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
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
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 now be able to choose the language from the application
94 Updating an existing translation
95 ================================
97 The steps are very similar to the ones above. Let's assume you have
98 noticed that the existing French translation is missing some of the
99 new strings introduced in a later version of nomnom.
101 cd nomnom-$release ;# cd to top source dir
102 ./gen-tr.sh -u ;# this updates all existing .ts files
103 linguist tr/NomNom_fr_FR.ts ;# edit the update .ts
104 mkdir tmp ; cd tmp ;# cd to 'tmp' dir
105 ../configure ; make ;# build nomnom
108 The "make" produces the updated .qm file initially. If you, however,
109 edit the ../tr/NomNom_fr_FR.ts file after this, you have to:
111 (edit ../tr/NomNom_fr_FR.ts)
112 ../gen-tr.sh -r ../tr/NomNom_fr_FR.ts ;# produce .qm file
113 cp ../tr/NomNom_fr_FR.qm tr/ ;# cp .qm to $top_srcdir/tmp/tr/
115 This is because the current Makefiles do not track the .ts files for
118 Once you have (re)generated the .qm, you can:
120 env LANG=fr_FR.UTF-8 ./src/nomnom ;# assumes "language=" in config
122 See the notes above about LANG and choosing the language from the
126 Contributing .ts to the project
127 ===============================
129 If you would like to contribute your .ts (new or updated) to the project,
130 please open a new ticket at:
131 http://sourceforge.net/apps/trac/nomnom ;# you will need sf account
133 We can then add the .ts to the nomnom dist. Thanks!