Skip to content

Commit

Permalink
qt: add transifex configuration file
Browse files Browse the repository at this point in the history
This is a project-wide configuration file and should be the same for
everyone.
Also remove mention of creating it yourself from the translation
process.
  • Loading branch information
MitchellCash committed Nov 8, 2015
1 parent 32782e1 commit aa9f8ea
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 31 deletions.
7 changes: 7 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[main]
host = https://www.transifex.com

[paycoin.qt-translation-03x]
file_filter = src/qt/locale/paycoin_<lang>.ts
source_file = src/qt/locale/paycoin_en.ts
source_lang = en
66 changes: 35 additions & 31 deletions doc/translation_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ handle those translations.
Files and Folders
-----------------

### bitcoin-qt.pro
### paycoin.pro

This file takes care of generating `.qm` files from `.ts` files. It is mostly
automated.
Expand All @@ -28,53 +28,57 @@ This directory contains all translations. Filenames must adhere to this format:

paycoin_xx_YY.ts or paycoin_xx.ts

#### Source file
#### paycoin_en.ts (Source file)

`src/qt/locale/paycoin_en.ts` is treated in a special way. It is used as the
source for all other translations. Whenever a string in the code is changed
this file must be updated to reflect those changes. Usually, this can be
accomplished by running `lupdate` (included in the Qt SDK).
this file must be updated to reflect those changes. A custom script is used
to extract strings from the non-Qt parts. This script makes use of `gettext`,
so make sure that utility is installed (ie, `apt-get install gettext` on
Ubuntu/Debian). Once this has been updated, lupdate (included in the Qt SDK)
is used to update paycoin_en.ts. This process has been automated, from src/qt,
simply run:
make translate

An updated source file should be merged to github and transifex will pick it
up from there. Afterwards the new strings show up as "Remaining" in transifex
and can be translated.
##### Handling of plurals in the source file

Syncing with transifex
----------------------
When new plurals are added to the source file, it's important to do the following steps:

1. Open paycoin_en.ts in Qt Linguist (also included in the Qt SDK)
2. Search for `%n`, which will take you to the parts in the translation that use plurals
3. Look for empty `English Translation (Singular)` and `English Translation (Plural)` fields
4. Add the appropriate strings for the singular and plural form of the base string
5. Mark the item as done (via the green arrow symbol in the toolbar)
6. Repeat from step 2. until all singular and plural forms are in the source file
7. Save the source file

We are using http://transifex.net as a frontend for translating the client.
##### Creating the pull-request

https://www.transifex.net/projects/p/bitcoin/resource/tx/
An updated source file should be merged to github and Transifex will pick it
up from there (can take some hours). Afterwards the new strings show up as "Remaining"
in Transifex and can be translated.

The "transifex client" (see: http://help.transifex.net/features/client/)
will help with fetching new translations from transifex. Use the following
config to be able to connect with the client.
To create the pull-request you have to do:

### .tx/config
git add src/qt/bitcoinstrings.cpp src/qt/locale/paycoin_en.ts
git commit

[main]
host = https://www.transifex.net
Syncing with Transifex
----------------------

[bitcoin.tx]
file_filter = src/qt/locale/paycoin_<lang>.ts
source_file = src/qt/locale/paycoin_en.ts
source_lang = en

### .tx/config (for Windows)
We are using https://transifex.com as a frontend for translating the client.

[main]
host = https://www.transifex.net
https://www.transifex.com/paycoin/paycoin/qt-translation-03x/

[bitcoin.tx]
file_filter = src\qt\locale\paycoin_<lang>.ts
source_file = src\qt\locale\paycoin_en.ts
source_lang = en
The "Transifex client" (see: http://support.transifex.com/customer/portal/topics/440187-transifex-client/articles)
will help with fetching new translations from Transifex. The Transifex configuration (`.tx/config`)
is part of the repository.

It is also possible to directly download new translations one by one from transifex.
It is also possible to directly download new translations one by one from the Transifex website.

### Fetching new translations

1. `tx pull -a`
2. update `src/qt/bitcoin.qrc` manually or via
`ls src/qt/locale/*ts|xargs -n1 basename|sed 's/\(paycoin_\(.*\)\).ts/<file alias="\2">locale/\1.qm<\/file>/'`
`ls src/qt/locale/*ts|xargs -n1 basename|sed 's/\(paycoin_\(.*\)\).ts/<file alias="\2">locale\/\1.qm<\/file>/'`
3. `git add` new translations from `src/qt/locale/`

0 comments on commit aa9f8ea

Please sign in to comment.