| Adrià Vilanova MartÃnez | 73c01d4 | 2021-06-08 13:57:36 +0200 | [diff] [blame] | 1 | # i18n tools |
| 2 | This folder contains tools which aid in working with everything related to |
| 3 | the internationalization/localization of the extension. |
| 4 | |
| 5 | ## i18n summary |
| 6 | The extension strings are defined in `//src/_locales/en/manifest.json`, which is |
| 7 | the "source file". This file then is translated to multiple languages, each of |
| 8 | which has its own subfolder at `//src/_locales`. |
| 9 | |
| 10 | In order to streamline translation efforts, the translation is done in a |
| 11 | [Crowdin project](https://crowdin.com/project/translateselectedtext) (because |
| 12 | translators aren't always developers, and they might not know about git), which |
| 13 | is synced to this git repository via the tools offered in this folder. |
| 14 | |
| 15 | ## Tools |
| 16 | - `upload-sources.bash`: used to upload the `manifest.json` source file to |
| 17 | Crowdin, in order to sync it. |
| 18 | - `bump-translations.bash`: used to download updated translations from Crowdin |
| 19 | and create a new commit with the new updates. |
| 20 | - `generate-i18n-credits.go` (should not be called directly): used by the build |
| 21 | script to generate the list of translators which are displayed in the credits |
| 22 | dialog in the extension. The list of translators is retrieved from Crowdin, and |
| 23 | users listed in `blocked-users.txt` are removed from the list (some translators |
| 24 | who contributed before Crowdin was set up are also manually added to the list by |
| 25 | the script). |
| 26 | |
| 27 | ## Crowdin settings file |
| 28 | In order to use these tools, the crowdin settings file must be created and set |
| 29 | up: |
| 30 | |
| 31 | 1. Create a copy of `crowdin.template.yml` called `crowdin.yml`. |
| 32 | 2. Edit `crowdin.yml` replacing `{{API_TOKEN}}` by the actual API token. |