6 mkdir "./src/pending_locale" > /dev/null || true
7 mv ./src/locale/angular.*.xlf "./src/pending_locale"
9 if [ ! -z ${1+x} ]; then
10 mv "./src/pending_locale/angular.$1.xlf" "./src/locale"
15 mv ./src/pending_locale/* "./src/locale"
16 rmdir "./src/pending_locale/"
19 # Previous build failed
20 if [ ! -f "client/src/locale/angular.fr-FR.xlf" ]; then
21 git checkout -- client/src/locale/
22 rm -r client/src/pending_locale
27 rm -rf ./dist ./compiled
31 defaultLanguage="en-US"
32 npm run ng build -- --output-path "dist/$defaultLanguage/" --deploy-url "/client/$defaultLanguage/" --prod --stats-json
33 mv "./dist/$defaultLanguage/assets" "./dist"
34 mv "./dist/$defaultLanguage/manifest.webmanifest" "./dist/manifest.webmanifest"
38 # Don't build other languages if --light arg is provided
39 if [ -z ${1+x} ] || [ "$1" != "--light" ]; then
40 if [ ! -z ${1+x} ] && [ "$1" == "--light-fr" ]; then
46 "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"
47 "fr-FR" "ja-JP" "eu-ES" "ca-ES" "cs-CZ" "eo" "de-DE" "it-IT"
51 for lang in "${languages[@]}"; do
52 # TODO: remove when the project will use runtime translations
53 pre_build_hook "$lang"
55 npm run ng build -- --prod --i18n-file "./src/locale/angular.$lang.xlf" --i18n-format xlf --i18n-locale "$lang" \
56 --output-path "dist/$lang/" --deploy-url "/client/$lang/"
58 # Do not duplicate assets
59 rm -r "./dist/$lang/assets"
61 # TODO: remove when the project will use runtime translations
66 cd ../ && npm run build:embed && cd client/
68 # Copy runtime locales
69 cp -r "./src/locale" "./dist/locale"