diff options
author | Chocobozzz <me@florianbigard.com> | 2020-08-12 10:40:04 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-08-14 10:28:30 +0200 |
commit | 66357162f8e1227495f09bd4f68446aad7071c6d (patch) | |
tree | 7d4429506deb512b2fe1d0267f38a28cda20af55 /scripts/i18n/generate.sh | |
parent | 8c360747995e17eb5520e22fc3d7bd4c3d26eeee (diff) | |
download | PeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.tar.gz PeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.tar.zst PeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.zip |
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
Diffstat (limited to 'scripts/i18n/generate.sh')
-rwxr-xr-x | scripts/i18n/generate.sh | 8 |
1 files changed, 6 insertions, 2 deletions
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 @@ | |||
2 | 2 | ||
3 | set -eu | 3 | set -eu |
4 | 4 | ||
5 | npm run build -- --i18n | ||
6 | |||
5 | cd client | 7 | cd client |
6 | npm run ng -- xi18n --i18n-locale "en-US" --output-path src/locale --out-file angular.xlf | 8 | ./node_modules/.bin/localize-extract -r . -f xliff --locale "en-US" -s 'dist/en-US/*.js' -o src/locale/angular.xlf |
7 | npm run ngx-extractor -- --locale "en-US" -i 'src/**/*.ts' -f xlf -o src/locale/angular.xlf | 9 | |
10 | # Workaround of https://github.com/angular/angular/issues/38437 | ||
11 | sed -i 's/other {{INTERPOLATION}/other {<x id="INTERPOLATION"\/>/g' src/locale/angular.xlf | ||
8 | 12 | ||
9 | # Merge new translations in other language files | 13 | # Merge new translations in other language files |
10 | npm run ng run -- PeerTube:xliffmerge | 14 | npm run ng run -- PeerTube:xliffmerge |