4 The Qt GUI can be easily translated into other languages. Here's how we
5 handle those translations.
12 This file takes care of generating `.qm` files from `.ts` files. It is mostly
15 ### src/qt/bitcoin.qrc
17 This file must be updated whenever a new translation is added. Please note that
18 files must end with `.qm`, not `.ts`.
20 <qresource prefix="/translations">
21 <file alias="en">locale/bitcoin_en.qm</file>
27 This directory contains all translations. Filenames must adhere to this format:
29 bitcoin_xx_YY.ts or bitcoin_xx.ts
31 #### bitcoin_en.ts (Source file)
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. A custom script is used
36 to extract strings from the non-Qt parts. This script makes use of `gettext`,
37 so make sure that utility is installed (ie, `apt-get install gettext` on
38 Ubuntu/Debian). Once this has been updated, lupdate (included in the Qt SDK)
39 is used to update bitcoin_en.ts. This process has been automated, from src/qt,
43 ##### Handling of plurals in the source file
45 When new plurals are added to the source file, it's important to do the following steps:
47 1. Open bitcoin_en.ts in Qt Linguist (also included in the Qt SDK)
48 2. Search for `%n`, which will take you to the parts in the translation that use plurals
49 3. Look for empty `English Translation (Singular)` and `English Translation (Plural)` fields
50 4. Add the appropriate strings for the singular and plural form of the base string
51 5. Mark the item as done (via the green arrow symbol in the toolbar)
52 6. Repeat from step 2. until all singular and plural forms are in the source file
53 7. Save the source file
55 ##### Creating the pull-request
57 An updated source file should be merged to github and Transifex will pick it
58 up from there (can take some hours). Afterwards the new strings show up as "Remaining"
59 in Transifex and can be translated.
61 To create the pull-request you have to do:
63 git add src/qt/bitcoinstrings.cpp src/qt/locale/bitcoin_en.ts
66 Syncing with Transifex
67 ----------------------
69 We are using https://transifex.com as a frontend for translating the client.
71 https://www.transifex.com/projects/p/bitcoin/resource/tx/
73 The "Transifex client" (see: http://support.transifex.com/customer/portal/topics/440187-transifex-client/articles)
74 is used to fetch new translations from Transifex. The configuration for this client (`.tx/config`)
75 is part of the repository.
77 Do not directly download translations one by one from the Transifex website, as we do a few
78 postprocessing steps before committing the translations.
80 ### Fetching new translations
82 1. `python contrib/devtools/update-translations.py`
83 2. update `src/qt/bitcoin.qrc` manually or via
84 `ls src/qt/locale/*ts|xargs -n1 basename|sed 's/\(bitcoin_\(.*\)\).ts/<file alias="\2">locale\/\1.qm<\/file>/'`
85 3. update `src/qt/Makefile.am` manually or via
86 `ls src/qt/locale/*ts|xargs -n1 basename|sed 's/\(bitcoin_\(.*\)\).ts/ locale\/\1.ts \\/'`
87 4. `git add` new translations from `src/qt/locale/`