From 81ad5366f745a0c0459016d3af5d18d1dd4501c0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 7 Nov 2019 16:02:16 +0100 Subject: Forgot a mention in changelog --- support/doc/development/release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'support') diff --git a/support/doc/development/release.md b/support/doc/development/release.md index c03075735..f8d041cfe 100644 --- a/support/doc/development/release.md +++ b/support/doc/development/release.md @@ -7,7 +7,7 @@ * `git checkout master && rm -r ./node_modules && yarn install --pure-lockfile && npm run build:server` * `NODE_APP_INSTANCE=6 NODE_ENV=test npm run start` and quit after initialization * `git checkout develop && rm -r ./node_modules && yarn install --pure-lockfile && npm run build:server` - * `NODE_APP_INSTANCE=6 NODE_ENV=test npm run start` and check migrations does not fail + * `NODE_APP_INSTANCE=6 NODE_ENV=test npm run start` and check migrations do not fail * Run `rm -r node_modules && rm -r client/node_modules && yarn install --pure-lockfile && npm run build` to see if all the supported languages compile correctly * Update https://peertube2.cpy.re and check it works correctly * Check CI tests are green -- cgit v1.2.3 From cd1d6c23dae0fd08e69d49b21333742db86eeff7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 13 Nov 2019 09:45:27 +0100 Subject: Remove unused files --- support/doc/translation.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'support') 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 @@ # Translation -We use [Zanata](http://zanata.org/) as translation platform. -Please do not edit xml files directly from Git, you have to use Zanata! +We use [Weblate](https://weblate.org) as translation platform. +Please do not edit translation files directly from Git, you have to use Weblate! -If you don't see your locale in the platform, please [create an issue](https://github.com/Chocobozzz/PeerTube/issues) so we add it! +If you don't see your locale in the platform you can add it directly in the Weblate interface. +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! ## How to - * Create an account: https://trad.framasoft.org/account/register - * Join a language team: https://trad.framasoft.org/languages - * Go to the PeerTube page https://trad.framasoft.org/iteration/view/peertube/develop - * Choose the locale and begin to translate PeerTube! + * Create an account: https://weblate.framasoft.org/accounts/register/ + * Validate your email and follow the link sent + * Create your password (keep the `Current password` field empty) and setup your account + * Go to the PeerTube page https://weblate.framasoft.org/projects/peertube/ + * Choose the file and the locale you want to translate ## Files @@ -20,10 +22,10 @@ There are 4 files: * **angular**: contains client strings * **player**: contains player strings. 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) - * **server**: contains server strings (privacies, licences...) - * **iso639**: contains iso639 (languages) strings used by PeerTube to describe the audio language of a particular video. + * **server**: contains server strings (privacies, licences...) and iso639 (languages) strings used by PeerTube to describe the audio language of a particular video. 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. + ## Tips ### Special tags @@ -39,7 +41,7 @@ should be in french ### Singular/plural -For singular/plural translations, you must translate values inside `{` and `}`. +For singular/plural translations, you must translate values inside `{` and `}`. **Please don't translate the word *other*** For example: -- cgit v1.2.3 From 2ef1d2bb74f333b05bbbbd27282605ee5654061e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 13 Nov 2019 10:02:41 +0100 Subject: Update localization dev guide --- support/doc/development/localization.md | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'support') 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 @@ # Application localization documentation -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`. +Source files are in `client/src/locale` and translated files merged from [Weblate](https://weblate.framasoft.org/translate/peertube). -## Generation -Will generate XLIFF files for Angular and escape inner elements in `source` tag because Zanata does not support them. +## Generation -This script will create `player_en_US.xml` XLIFF file using custom strings (VideoJS plugins) and strings from `videojs_en_US.json` file. +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`). +Then, it will merge new translation keys into localized Angular files (`angular.fr-FR.xlf` etc). -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). +**Only generate new translations after a Weblate pull to avoid conflicts** ``` $ npm run i18n:generate ``` -## Upload on Zanata -Push source source files (en-US) on Zanata: +## Upload on Weblate + +Nothing to do here, Github will automatically send a webhook to Weblate that will pull changes. -``` -$ zanata-cli push -``` ## Pull translation -Pull XLIFF files from Zanata, and unescape them (so we retrieve inner elements in `source` tag, used by Angular). -A hook converts `player` and `server`, `iso639` translation files to JSON (needed by Video.JS, and our application to have efficient runtime translation). -Then, `iso639` files will be merged in `server` files (so we have only one JSON file to serve server translations). + * First, save translations on Weblate so it commits changes. + * Then, fetch these commits: `git fetch weblate && git merge weblate/develop` -``` -$ zanata-cli pull -``` ## Support a new language * Add it to [/shared/models/i18n/i18n.ts](/shared/models/i18n/i18n.ts) * Add it to [/scripts/build/client.sh](/scripts/build/client.sh) - * Pull using zanata (that will execute hooks to correctly generate files of this new language) + * Add it to [/client/angular.json](/client/angular.json) in `xliffmergeOptions` section, then **pull** and **generate** * Build the application and check the new language correctly works -- cgit v1.2.3