]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - support/doc/development/localization.md
Merge branch 'weblate' into develop
[github/Chocobozzz/PeerTube.git] / support / doc / development / localization.md
CommitLineData
157b62b1
C
1# Application localization documentation
2
2ef1d2bb 3Source 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
8Will 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`).
9Then, it will merge new translation keys into localized Angular files (`angular.fr-FR.xlf` etc).
157b62b1 10
2ef1d2bb 11**Only generate new translations after a Weblate pull to avoid conflicts**
157b62b1
C
12
13```
14$ npm run i18n:generate
15```
16
157b62b1 17
2ef1d2bb
C
18## Upload on Weblate
19
20Nothing to do here, Github will automatically send a webhook to Weblate that will pull changes.
157b62b1 21
157b62b1
C
22
23## Pull translation
24
2ef1d2bb
C
25 * First, save translations on Weblate so it commits changes.
26 * Then, fetch these commits: `git fetch weblate && git merge weblate/develop`
157b62b1 27
2888c12b
C
28
29## Support a new language
30
31 * Add it to [/shared/models/i18n/i18n.ts](/shared/models/i18n/i18n.ts)
32 * Add it to [/scripts/build/client.sh](/scripts/build/client.sh)
2ef1d2bb 33 * Add it to [/client/angular.json](/client/angular.json) in `xliffmergeOptions` section, then **pull** and **generate**
2888c12b 34 * Build the application and check the new language correctly works