diff options
author | Chocobozzz <me@florianbigard.com> | 2019-11-13 10:05:27 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-11-13 10:05:27 +0100 |
commit | a42294c5edbdea3075c8defc03ba2cb73e0d86fc (patch) | |
tree | aca95591d1fb7ed89dd5f05f81406b4a4f282bac /support/doc | |
parent | f0c0c0abd88d0177f8be769f12d5affcacd934e8 (diff) | |
parent | 2ef1d2bb74f333b05bbbbd27282605ee5654061e (diff) | |
download | PeerTube-a42294c5edbdea3075c8defc03ba2cb73e0d86fc.tar.gz PeerTube-a42294c5edbdea3075c8defc03ba2cb73e0d86fc.tar.zst PeerTube-a42294c5edbdea3075c8defc03ba2cb73e0d86fc.zip |
Merge branch 'weblate' into develop
Diffstat (limited to 'support/doc')
-rw-r--r-- | support/doc/development/localization.md | 28 | ||||
-rw-r--r-- | support/doc/translation.md | 22 |
2 files changed, 23 insertions, 27 deletions
diff --git a/support/doc/development/localization.md b/support/doc/development/localization.md index 1664532fe..8aeb0c771 100644 --- a/support/doc/development/localization.md +++ b/support/doc/development/localization.md | |||
@@ -1,40 +1,34 @@ | |||
1 | # Application localization documentation | 1 | # Application localization documentation |
2 | 2 | ||
3 | Source files are in `client/src/locale/source` and translated files pulled from [Zanata](https://trad.framasoft.org/zanata/iteration/view/peertube/develop/languages/fr?dswid=-1605) in `client/src/locale/target`. | 3 | Source files are in `client/src/locale` and translated files merged from [Weblate](https://weblate.framasoft.org/translate/peertube). |
4 | 4 | ||
5 | ## Generation | ||
6 | 5 | ||
7 | Will generate XLIFF files for Angular and escape inner elements in `source` tag because Zanata does not support them. | 6 | ## Generation |
8 | 7 | ||
9 | This script will create `player_en_US.xml` XLIFF file using custom strings (VideoJS plugins) and strings from `videojs_en_US.json` file. | 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). | ||
10 | 10 | ||
11 | It will also create `server_en_US.xml` and `iso639_en_US.xml` XLIFF file using server strings and custom strings (defined inside the script, we did not find a way to extract them from TypeScript server files). | 11 | **Only generate new translations after a Weblate pull to avoid conflicts** |
12 | 12 | ||
13 | ``` | 13 | ``` |
14 | $ npm run i18n:generate | 14 | $ npm run i18n:generate |
15 | ``` | 15 | ``` |
16 | 16 | ||
17 | ## Upload on Zanata | ||
18 | 17 | ||
19 | Push source source files (en-US) on Zanata: | 18 | ## Upload on Weblate |
19 | |||
20 | Nothing to do here, Github will automatically send a webhook to Weblate that will pull changes. | ||
20 | 21 | ||
21 | ``` | ||
22 | $ zanata-cli push | ||
23 | ``` | ||
24 | 22 | ||
25 | ## Pull translation | 23 | ## Pull translation |
26 | 24 | ||
27 | Pull XLIFF files from Zanata, and unescape them (so we retrieve inner elements in `source` tag, used by Angular). | 25 | * First, save translations on Weblate so it commits changes. |
28 | A hook converts `player` and `server`, `iso639` translation files to JSON (needed by Video.JS, and our application to have efficient runtime translation). | 26 | * Then, fetch these commits: `git fetch weblate && git merge weblate/develop` |
29 | Then, `iso639` files will be merged in `server` files (so we have only one JSON file to serve server translations). | ||
30 | 27 | ||
31 | ``` | ||
32 | $ zanata-cli pull | ||
33 | ``` | ||
34 | 28 | ||
35 | ## Support a new language | 29 | ## Support a new language |
36 | 30 | ||
37 | * Add it to [/shared/models/i18n/i18n.ts](/shared/models/i18n/i18n.ts) | 31 | * Add it to [/shared/models/i18n/i18n.ts](/shared/models/i18n/i18n.ts) |
38 | * Add it to [/scripts/build/client.sh](/scripts/build/client.sh) | 32 | * Add it to [/scripts/build/client.sh](/scripts/build/client.sh) |
39 | * Pull using zanata (that will execute hooks to correctly generate files of this new language) | 33 | * Add it to [/client/angular.json](/client/angular.json) in `xliffmergeOptions` section, then **pull** and **generate** |
40 | * Build the application and check the new language correctly works | 34 | * Build the application and check the new language correctly works |
diff --git a/support/doc/translation.md b/support/doc/translation.md index 58b52f5f8..1a3e59f9f 100644 --- a/support/doc/translation.md +++ b/support/doc/translation.md | |||
@@ -1,17 +1,19 @@ | |||
1 | # Translation | 1 | # Translation |
2 | 2 | ||
3 | We use [Zanata](http://zanata.org/) as translation platform. | 3 | We use [Weblate](https://weblate.org) as translation platform. |
4 | Please do not edit xml files directly from Git, you have to use Zanata! | 4 | Please do not edit translation files directly from Git, you have to use Weblate! |
5 | 5 | ||
6 | If you don't see your locale in the platform, please [create an issue](https://github.com/Chocobozzz/PeerTube/issues) so we add it! | 6 | If you don't see your locale in the platform you can add it directly in the Weblate interface. |
7 | Then, if you think there are enough translated strings, please [create an issue](https://github.com/Chocobozzz/PeerTube/issues) so we add the new locale in PeerTube! | ||
7 | 8 | ||
8 | 9 | ||
9 | ## How to | 10 | ## How to |
10 | 11 | ||
11 | * Create an account: https://trad.framasoft.org/account/register | 12 | * Create an account: https://weblate.framasoft.org/accounts/register/ |
12 | * Join a language team: https://trad.framasoft.org/languages | 13 | * Validate your email and follow the link sent |
13 | * Go to the PeerTube page https://trad.framasoft.org/iteration/view/peertube/develop | 14 | * Create your password (keep the `Current password` field empty) and setup your account |
14 | * Choose the locale and begin to translate PeerTube! | 15 | * Go to the PeerTube page https://weblate.framasoft.org/projects/peertube/ |
16 | * Choose the file and the locale you want to translate | ||
15 | 17 | ||
16 | 18 | ||
17 | ## Files | 19 | ## Files |
@@ -20,10 +22,10 @@ There are 4 files: | |||
20 | * **angular**: contains client strings | 22 | * **angular**: contains client strings |
21 | * **player**: contains player strings. | 23 | * **player**: contains player strings. |
22 | Most of the strings come from VideoJS, so you can help yourself by using [video.js JSON files](https://github.com/videojs/video.js/tree/master/lang) | 24 | Most of the strings come from VideoJS, so you can help yourself by using [video.js JSON files](https://github.com/videojs/video.js/tree/master/lang) |
23 | * **server**: contains server strings (privacies, licences...) | 25 | * **server**: contains server strings (privacies, licences...) and iso639 (languages) strings used by PeerTube to describe the audio language of a particular video. |
24 | * **iso639**: contains iso639 (languages) strings used by PeerTube to describe the audio language of a particular video. | ||
25 | It's the reason why these strings should be translated too. There are many strings so do not hesitate to translate only main audio languages. | 26 | It's the reason why these strings should be translated too. There are many strings so do not hesitate to translate only main audio languages. |
26 | 27 | ||
28 | |||
27 | ## Tips | 29 | ## Tips |
28 | 30 | ||
29 | ### Special tags | 31 | ### Special tags |
@@ -39,7 +41,7 @@ should be in french | |||
39 | 41 | ||
40 | ### Singular/plural | 42 | ### Singular/plural |
41 | 43 | ||
42 | For singular/plural translations, you must translate values inside `{` and `}`. | 44 | For singular/plural translations, you must translate values inside `{` and `}`. **Please don't translate the word *other*** |
43 | 45 | ||
44 | For example: | 46 | For example: |
45 | 47 | ||