Changeset View
Changeset View
Standalone View
Standalone View
doc/translation_process.md
Show All 16 Lines | |||||
`src/qt/locale/bitcoin_en.ts` is treated in a special way. It is used as the source for all other translations. Whenever a string in the source code is changed, 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 `bitcoin_en.ts`. | `src/qt/locale/bitcoin_en.ts` is treated in a special way. It is used as the source for all other translations. Whenever a string in the source code is changed, 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 `bitcoin_en.ts`. | ||||
To regenerate the `bitcoin_en.ts` file, run the following commands: | To regenerate the `bitcoin_en.ts` file, run the following commands: | ||||
```sh | ```sh | ||||
cd <build-dir>/src/ | cd <build-dir>/src/ | ||||
make translate | make translate | ||||
``` | ``` | ||||
`contrib/bitcoin-qt.pro` takes care of generating `.qm` (binary compiled) files from `.ts` (source files) files. It’s mostly automated, and you shouldn’t need to worry about it. | `contrib/ecash-qt.pro` takes care of generating `.qm` (binary compiled) files from `.ts` (source files) files. It’s mostly automated, and you shouldn’t need to worry about it. | ||||
**Example Qt translation** | **Example Qt translation** | ||||
```cpp | ```cpp | ||||
QToolBar *toolbar = addToolBar(tr("Tabs toolbar")); | QToolBar *toolbar = addToolBar(tr("Tabs toolbar")); | ||||
``` | ``` | ||||
### Creating a pull-request | ### Creating a pull-request | ||||
For general PRs, you shouldn’t include any updates to the translation source files. They will be updated periodically, primarily around pre-releases, allowing time for any new phrases to be translated before public releases. This is also important in avoiding translation related merge conflicts. | For general PRs, you shouldn’t include any updates to the translation source files. They will be updated periodically, primarily around pre-releases, allowing time for any new phrases to be translated before public releases. This is also important in avoiding translation related merge conflicts. | ||||
▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines |