]>
Commit | Line | Data |
---|---|---|
157b62b1 C |
1 | # Application localization documentation |
2 | ||
2ef1d2bb | 3 | Source files are in `client/src/locale` and translated files merged from [Weblate](https://weblate.framasoft.org/translate/peertube). |
157b62b1 | 4 | |
157b62b1 | 5 | |
2ef1d2bb | 6 | ## Generation |
157b62b1 | 7 | |
2ef1d2bb C |
8 | Will generate XLIFF base files for Angular (`angular.xlf`) and JSON files for the player (`player.en-US.json`) and the server (`server.en-US.json`). |
9 | Then, it will merge new translation keys into localized Angular files (`angular.fr-FR.xlf` etc). | |
157b62b1 | 10 | |
157b62b1 | 11 | ``` |
49a56c72 | 12 | $ npm run i18n:update |
157b62b1 C |
13 | ``` |
14 | ||
157b62b1 | 15 | |
2ef1d2bb C |
16 | ## Upload on Weblate |
17 | ||
18 | Nothing to do here, Github will automatically send a webhook to Weblate that will pull changes. | |
157b62b1 | 19 | |
157b62b1 C |
20 | |
21 | ## Pull translation | |
22 | ||
2ef1d2bb C |
23 | * First, save translations on Weblate so it commits changes. |
24 | * Then, fetch these commits: `git fetch weblate && git merge weblate/develop` | |
157b62b1 | 25 | |
2888c12b C |
26 | |
27 | ## Support a new language | |
28 | ||
29 | * Add it to [/shared/models/i18n/i18n.ts](/shared/models/i18n/i18n.ts) | |
30 | * Add it to [/scripts/build/client.sh](/scripts/build/client.sh) | |
5638df08 | 31 | * Add it to [/client/angular.json](/client/angular.json) |
61a4bad5 C |
32 | * Add it to [/scripts/i18n/update.sh](/scripts/i18n/update.sh) |
33 | * Lock [weblate project](https://weblate.framasoft.org/projects/peertube) | |
34 | * Run `npm run i18n:update` | |
2888c12b | 35 | * Build the application and check the new language correctly works |