8 mkdir "./src/pending_locale" > /dev/null || true
9 mv ./src/locale/angular.*.xlf "./src/pending_locale"
11 if [ ! -z ${1+x} ]; then
12 mv "./src/pending_locale/angular.$1.xlf" "./src/locale"
17 mv ./src/pending_locale/* "./src/locale"
18 rmdir "./src/pending_locale/"
21 # Previous build failed
22 if [ ! -f "client/src/locale/angular.fr-FR.xlf" ]; then
23 git checkout -- client/src/locale/
24 rm -r client/src/pending_locale
29 rm -rf ./dist ./compiled
33 defaultLanguage="en-US"
34 npm run ng build -- --output-path "dist/$defaultLanguage/" --deploy-url "/client/$defaultLanguage/" --prod --stats-json
35 mv "./dist/$defaultLanguage/assets" "./dist"
36 mv "./dist/$defaultLanguage/manifest.webmanifest" "./dist/manifest.webmanifest"
40 # Don't build other languages if --light arg is provided
41 if [ -z ${1+x} ] || [ "$1" != "--light" ]; then
42 if [ ! -z ${1+x} ] && [ "$1" == "--light-fr" ]; then
43 languages=(["fr"]="fr-FR")
60 ["zh-Hans"]="zh-Hans-CN"
61 ["zh-Hant"]="zh-Hant-TW"
73 for key in "${!languages[@]}"; do
74 lang=${languages[$key]}
76 # TODO: remove when the project will use runtime translations
77 pre_build_hook "$lang"
79 npm run ng build -- --output-path "dist/build" --deploy-url "/client/$lang/" --prod --configuration="$lang"
81 mv "dist/build/$key" "dist/$lang"
84 # Do not duplicate assets
85 rm -r "./dist/$lang/assets"
87 # TODO: remove when the project will use runtime translations
92 cd ../ && npm run build:embed && cd client/
94 # Copy runtime locales
95 cp -r "./src/locale" "./dist/locale"