From 49a56c72031802addffcaa8d6c374720d17e4d14 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 24 Aug 2020 09:35:27 +0200 Subject: Use update i18n command instead of generate --- package.json | 2 +- scripts/i18n/generate.sh | 18 ------------------ scripts/i18n/update.sh | 20 ++++++++++++++++++++ support/doc/development/localization.md | 4 +--- 4 files changed, 22 insertions(+), 22 deletions(-) delete mode 100755 scripts/i18n/generate.sh create mode 100755 scripts/i18n/update.sh diff --git a/package.json b/package.json index 02c456e82..946b53018 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "danger:clean:dev": "scripty", "danger:clean:prod": "scripty", "danger:clean:modules": "scripty", - "i18n:generate": "scripty", + "i18n:update": "scripty", "plugin:install": "node ./dist/scripts/plugin/install.js", "plugin:uninstall": "node ./dist/scripts/plugin/uninstall.js", "i18n:create-custom-files": "node ./dist/scripts/i18n/create-custom-files.js", diff --git a/scripts/i18n/generate.sh b/scripts/i18n/generate.sh deleted file mode 100755 index 0d1cd35c0..000000000 --- a/scripts/i18n/generate.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -set -eu - -npm run build -- --i18n - -cd client -./node_modules/.bin/localize-extract -r . -f xliff --locale "en-US" -s 'dist/en-US/*.js' -o src/locale/angular.xlf - -# Workaround of https://github.com/angular/angular/issues/38437 -sed -i 's/other {{INTERPOLATION}/other {/g' src/locale/angular.xlf - -# Merge new translations in other language files -npm run ng run -- PeerTube:xliffmerge - -# Add our strings too -cd ../ -npm run i18n:create-custom-files diff --git a/scripts/i18n/update.sh b/scripts/i18n/update.sh new file mode 100755 index 000000000..916918f84 --- /dev/null +++ b/scripts/i18n/update.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +set -eu + +git fetch weblate && git merge weblate/develop + +npm run build -- --i18n + +cd client +./node_modules/.bin/localize-extract -r . -f xliff --locale "en-US" -s 'dist/en-US/*.js' -o src/locale/angular.xlf + +# Workaround of https://github.com/angular/angular/issues/38437 +sed -i 's/other {{INTERPOLATION}/other {/g' src/locale/angular.xlf + +# Merge new translations in other language files +npm run ng run -- PeerTube:xliffmerge + +# Add our strings too +cd ../ +npm run i18n:create-custom-files diff --git a/support/doc/development/localization.md b/support/doc/development/localization.md index 626c0ff9f..3d09bbecb 100644 --- a/support/doc/development/localization.md +++ b/support/doc/development/localization.md @@ -8,10 +8,8 @@ Source files are in `client/src/locale` and translated files merged from [Weblat 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). -**Only generate new translations after a Weblate pull to avoid conflicts** - ``` -$ npm run i18n:generate +$ npm run i18n:update ``` -- cgit v1.2.3