aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build/client.sh28
-rwxr-xr-xscripts/watch/server.sh2
2 files changed, 15 insertions, 15 deletions
diff --git a/scripts/build/client.sh b/scripts/build/client.sh
index 9dfa6c618..2518702cf 100755
--- a/scripts/build/client.sh
+++ b/scripts/build/client.sh
@@ -3,23 +3,23 @@
3set -eu 3set -eu
4 4
5pre_build_hook () { 5pre_build_hook () {
6 mkdir "./src/locale/pending_target/" > /dev/null || true 6 mkdir "./src/pending_locale" > /dev/null || true
7 mv ./src/locale/target/angular_*.xml "./src/locale/pending_target" 7 mv ./src/locale/angular.*.xlf "./src/pending_locale"
8 8
9 if [ ! -z ${1+x} ]; then 9 if [ ! -z ${1+x} ]; then
10 mv "./src/locale/pending_target/angular_$1.xml" "./src/locale/target" 10 mv "./src/pending_locale/angular.$1.xlf" "./src/locale"
11 fi 11 fi
12} 12}
13 13
14post_build_hook () { 14post_build_hook () {
15 mv ./src/locale/pending_target/* "./src/locale/target/" 15 mv ./src/pending_locale/* "./src/locale"
16 rmdir "./src/locale/pending_target/" 16 rmdir "./src/pending_locale/"
17} 17}
18 18
19# Previous build failed 19# Previous build failed
20if [ ! -f client/src/locale/target/angular_fr_FR.xml ]; then 20if [ ! -f "client/src/locale/angular.fr-FR.xlf" ]; then
21 git checkout -- client/src/locale/target/ 21 git checkout -- client/src/locale/
22 rm -r client/src/locale/pending_target/ 22 rm -r client/src/pending_locale
23fi 23fi
24 24
25cd client 25cd client
@@ -28,7 +28,7 @@ rm -rf ./dist ./compiled
28 28
29pre_build_hook 29pre_build_hook
30 30
31defaultLanguage="en_US" 31defaultLanguage="en-US"
32npm run ng build -- --output-path "dist/$defaultLanguage/" --deploy-url "/client/$defaultLanguage/" --prod --stats-json 32npm run ng build -- --output-path "dist/$defaultLanguage/" --deploy-url "/client/$defaultLanguage/" --prod --stats-json
33mv "./dist/$defaultLanguage/assets" "./dist" 33mv "./dist/$defaultLanguage/assets" "./dist"
34mv "./dist/$defaultLanguage/manifest.webmanifest" "./dist/manifest.webmanifest" 34mv "./dist/$defaultLanguage/manifest.webmanifest" "./dist/manifest.webmanifest"
@@ -38,12 +38,12 @@ post_build_hook
38# Don't build other languages if --light arg is provided 38# Don't build other languages if --light arg is provided
39if [ -z ${1+x} ] || [ "$1" != "--light" ]; then 39if [ -z ${1+x} ] || [ "$1" != "--light" ]; then
40 if [ ! -z ${1+x} ] && [ "$1" == "--light-fr" ]; then 40 if [ ! -z ${1+x} ] && [ "$1" == "--light-fr" ]; then
41 languages=("fr_FR") 41 languages=("fr-FR")
42 else 42 else
43 # Supported languages 43 # Supported languages
44 languages=( 44 languages=(
45 "fi_FI" "nl_NL" "gd" "el_GR" "es_ES" "oc" "pt_BR" "pt_PT" "sv_SE" "pl_PL" "ru_RU" "zh_Hans_CN" "zh_Hant_TW" 45 "fi-FI" "nl-NL" "gd" "el-GR" "es-ES" "oc" "pt-BR" "pt-PT" "sv-SE" "pl-PL" "ru-RU" "zh-Hans-CN" "zh-Hant-TW"
46 "fr_FR" "ja_JP" "eu_ES" "ca_ES" "cs_CZ" "eo" "de_DE" "it_IT" 46 "fr-FR" "ja-JP" "eu-ES" "ca-ES" "cs-CZ" "eo" "de-DE" "it-IT"
47 ) 47 )
48 fi 48 fi
49 49
@@ -51,7 +51,7 @@ if [ -z ${1+x} ] || [ "$1" != "--light" ]; then
51 # TODO: remove when the project will use runtime translations 51 # TODO: remove when the project will use runtime translations
52 pre_build_hook "$lang" 52 pre_build_hook "$lang"
53 53
54 npm run ng build -- --prod --i18n-file "./src/locale/target/angular_$lang.xml" --i18n-format xlf --i18n-locale "$lang" \ 54 npm run ng build -- --prod --i18n-file "./src/locale/angular.$lang.xlf" --i18n-format xlf --i18n-locale "$lang" \
55 --output-path "dist/$lang/" --deploy-url "/client/$lang/" 55 --output-path "dist/$lang/" --deploy-url "/client/$lang/"
56 56
57 # Do not duplicate assets 57 # Do not duplicate assets
@@ -65,4 +65,4 @@ fi
65NODE_ENV=production npm run webpack -- --config webpack/webpack.video-embed.js --mode production --json > "./dist/embed-stats.json" 65NODE_ENV=production npm run webpack -- --config webpack/webpack.video-embed.js --mode production --json > "./dist/embed-stats.json"
66 66
67# Copy runtime locales 67# Copy runtime locales
68cp -r "./src/locale/target" "./dist/locale" 68cp -r "./src/locale" "./dist/locale"
diff --git a/scripts/watch/server.sh b/scripts/watch/server.sh
index 635bebf8e..8d8470954 100755
--- a/scripts/watch/server.sh
+++ b/scripts/watch/server.sh
@@ -5,7 +5,7 @@ set -eu
5# Copy locales 5# Copy locales
6mkdir -p "./client/dist" 6mkdir -p "./client/dist"
7rm -rf "./client/dist/locale" 7rm -rf "./client/dist/locale"
8cp -r "./client/src/locale/target" "./client/dist/locale" 8cp -r "./client/src/locale" "./client/dist/locale"
9 9
10rm -rf "./dist" 10rm -rf "./dist"
11 11