From 66357162f8e1227495f09bd4f68446aad7071c6d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 12 Aug 2020 10:40:04 +0200 Subject: Migrate to $localize * Remove i18n polyfill to translate things in components * Reduce bundle sizes * Improve runtime perf * Reduce a lot the time to make a full client build * Reduce client build complexity * We don't need a service to translate things anymore (so we will be able to translate title pages etc) Unfortunately we may loose some translations in the migration process. I'll put a message on weblate to notify translators --- scripts/i18n/generate.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts/i18n/generate.sh') diff --git a/scripts/i18n/generate.sh b/scripts/i18n/generate.sh index f9c2f0613..0d1cd35c0 100755 --- a/scripts/i18n/generate.sh +++ b/scripts/i18n/generate.sh @@ -2,9 +2,13 @@ set -eu +npm run build -- --i18n + cd client -npm run ng -- xi18n --i18n-locale "en-US" --output-path src/locale --out-file angular.xlf -npm run ngx-extractor -- --locale "en-US" -i 'src/**/*.ts' -f xlf -o src/locale/angular.xlf +./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 -- cgit v1.2.3