mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Prepare i18n files
This commit is contained in:
@@ -6,5 +6,19 @@ cd client
|
||||
|
||||
rm -rf ./dist ./compiled
|
||||
|
||||
npm run ng build -- --prod --stats-json
|
||||
defaultLanguage="en-US"
|
||||
npm run ng build -- --output-path "dist/$defaultLanguage/" --deploy-url "/client/$defaultLanguage/" --prod --stats-json
|
||||
mv "./dist/$defaultLanguage/assets" "./dist"
|
||||
|
||||
languages="fr"
|
||||
|
||||
for lang in "$languages"; do
|
||||
npm run ng build -- --prod --i18n-file "./src/locale/target/messages_$lang.xml" --i18n-format xlf --i18n-locale "$lang" \
|
||||
--output-path "dist/$lang/" --deploy-url "/client/$lang/"
|
||||
|
||||
# Do no duplicate assets
|
||||
rm -r "./dist/$lang/assets"
|
||||
done
|
||||
|
||||
NODE_ENV=production npm run webpack -- --config webpack/webpack.video-embed.js --mode production
|
||||
|
||||
|
||||
11
scripts/i18n/generate.sh
Executable file
11
scripts/i18n/generate.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
cd client
|
||||
npm run ng -- xi18n --i18n-locale "en-US" --output-path locale/source --out-file messages_en_US.xml
|
||||
npm run ngx-extractor -- --locale "en-US" -i 'src/**/*.ts' -f xlf -o src/locale/source/messages_en_US.xml
|
||||
|
||||
# Zanata does not support inner elements in <source>, so we hack these special elements
|
||||
# This regex translate the Angular elements to special entities (that we will reconvert on pull)
|
||||
sed -i 's/<x id=\([^\/]\+\?\)\/>/\<x id=\1\/\>/g' src/locale/source/messages_en_US.xml
|
||||
7
scripts/i18n/pull-hook.sh
Executable file
7
scripts/i18n/pull-hook.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
# Zanata does not support inner elements in <source>, so we hack these special elements
|
||||
# This regex translate the converted elements to initial Angular elements
|
||||
sed -i 's/\<x id=\([^\/]\+\?\)\/\>/<x id=\1\/>/g' client/src/locale/target/*
|
||||
@@ -57,7 +57,7 @@ git commit package.json client/package.json -m "Bumped to version $version"
|
||||
git tag -s -a "$version" -m "$version"
|
||||
|
||||
npm run build
|
||||
rm "./client/dist/stats.json"
|
||||
rm "./client/dist/en-US/stats.json"
|
||||
|
||||
# Creating the archives
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user