diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build/client.sh | 28 | ||||
-rwxr-xr-x | scripts/watch/server.sh | 2 |
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 @@ | |||
3 | set -eu | 3 | set -eu |
4 | 4 | ||
5 | pre_build_hook () { | 5 | pre_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 | ||
14 | post_build_hook () { | 14 | post_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 |
20 | if [ ! -f client/src/locale/target/angular_fr_FR.xml ]; then | 20 | if [ ! -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 |
23 | fi | 23 | fi |
24 | 24 | ||
25 | cd client | 25 | cd client |
@@ -28,7 +28,7 @@ rm -rf ./dist ./compiled | |||
28 | 28 | ||
29 | pre_build_hook | 29 | pre_build_hook |
30 | 30 | ||
31 | defaultLanguage="en_US" | 31 | defaultLanguage="en-US" |
32 | npm run ng build -- --output-path "dist/$defaultLanguage/" --deploy-url "/client/$defaultLanguage/" --prod --stats-json | 32 | npm run ng build -- --output-path "dist/$defaultLanguage/" --deploy-url "/client/$defaultLanguage/" --prod --stats-json |
33 | mv "./dist/$defaultLanguage/assets" "./dist" | 33 | mv "./dist/$defaultLanguage/assets" "./dist" |
34 | mv "./dist/$defaultLanguage/manifest.webmanifest" "./dist/manifest.webmanifest" | 34 | mv "./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 |
39 | if [ -z ${1+x} ] || [ "$1" != "--light" ]; then | 39 | if [ -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 | |||
65 | NODE_ENV=production npm run webpack -- --config webpack/webpack.video-embed.js --mode production --json > "./dist/embed-stats.json" | 65 | NODE_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 |
68 | cp -r "./src/locale/target" "./dist/locale" | 68 | cp -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 |
6 | mkdir -p "./client/dist" | 6 | mkdir -p "./client/dist" |
7 | rm -rf "./client/dist/locale" | 7 | rm -rf "./client/dist/locale" |
8 | cp -r "./client/src/locale/target" "./client/dist/locale" | 8 | cp -r "./client/src/locale" "./client/dist/locale" |
9 | 9 | ||
10 | rm -rf "./dist" | 10 | rm -rf "./dist" |
11 | 11 | ||