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