updated translation process documentation
[novacoin.git] / doc / translation_process.md
1 Translations
2 ============
3
4 The Qt GUI can be easily translated into other languages. Here's how we
5 handle those translations.
6
7 Files and Folders
8 -----------------
9
10 ### bitcoin-qt.pro
11
12 This file takes care of generating `.qm` files from `.ts` files. It is mostly
13 automated.
14
15 ### src/qt/bitcoin.qrc
16
17 This file must be updated whenever a new translation is added. Please note that
18 files must end with `.qm`, not `.ts`.
19
20     <qresource prefix="/translations">
21         <file alias="en">locale/bitcoin_en.qm</file>
22         ...
23     </qresource>
24
25 ### src/qt/locale/
26
27 This directory contains all translations. Filenames must adhere to this format:
28
29     bitcoin_xx_YY.ts or bitcoin_xx.ts
30
31 #### Source file
32
33 `src/qt/locale/bitcoin_en.ts` is treated in a special way. It is used as the
34 source for all other translations. Whenever a string in the code is changed
35 this file must be updated to reflect those changes. Usually, this can be
36 accomplished by running `lupdate` (included in the Qt SDK).
37
38 An updated source file should be merged to github and transifex will pick it
39 up from there. Afterwards the new strings show up as "Remaining" in transifex
40 and can be translated.
41
42 Syncing with transifex
43 ----------------------
44
45 We are using http://transifex.net as a frontend for translating the client.
46
47 https://www.transifex.net/projects/p/bitcoin/resource/tx/
48
49 The "transifex client" (see: http://help.transifex.net/features/client/)
50 will help with fetching new translations from transifex. Use the following
51 config to be able to connect with the client.
52
53 ### .tx/config
54
55     [main]
56     host = https://www.transifex.net
57
58     [bitcoin.tx]
59     file_filter = src/qt/locale/bitcoin_<lang>.ts
60     source_file = src/qt/locale/bitcoin_en.ts
61     source_lang = en
62     
63 ### .tx/config (for Windows)
64
65     [main]
66     host = https://www.transifex.net
67
68     [bitcoin.tx]
69     file_filter = src\qt\locale\bitcoin_<lang>.ts
70     source_file = src\qt\locale\bitcoin_en.ts
71     source_lang = en
72
73 It is also possible to directly download new translations one by one from transifex.
74
75 ### Fetching new translations
76
77 1. `tx pull -a`
78 2. update `src/qt/bitcoin.qrc` manually or via
79    `ls src/qt/locale/*ts|xargs -n1 basename|sed 's/\(bitcoin_\(.*\)\).ts/<file alias="\2">locale/\1.qm<\/file>/'`
80 3. `git add` new translations from `src/qt/locale/`