6 mkdir "./src/locale/pending_target/" > /dev/null || true
7 mv ./src/locale/target/angular_*.xml "./src/locale/pending_target"
9 if [ ! -z ${1+x} ]; then
10 mv "./src/locale/pending_target/angular_$1.xml" "./src/locale/target"
15 mv ./src/locale/pending_target/* "./src/locale/target/"
16 rmdir "./src/locale/pending_target/"
19 # Previous build failed
20 if [ ! -f client/src/locale/target/angular_fr_FR.xml ]; then
21 git checkout -- client/src/locale/target/
22 rm -r client/src/locale/pending_target/
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
44 languages=("nl_NL" "es_ES" "oc" "pt_BR" "pt_PT" "sv_SE" "pl_PL" "ru_RU" "zh_Hans_CN" "zh_Hant_TW" "fr_FR" "ja_JP" "eu_ES" "ca_ES" "cs_CZ" "eo" "de_DE" "it_IT")
47 for lang in "${languages[@]}"; do
48 # TODO: remove when the project will use runtime translations
49 pre_build_hook "$lang"
51 npm run ng build -- --prod --i18n-file "./src/locale/target/angular_$lang.xml" --i18n-format xlf --i18n-locale "$lang" \
52 --output-path "dist/$lang/" --deploy-url "/client/$lang/"
54 # Do not duplicate assets
55 rm -r "./dist/$lang/assets"
57 # TODO: remove when the project will use runtime translations
62 NODE_ENV=production npm run webpack -- --config webpack/webpack.video-embed.js --mode production --json > "./dist/embed-stats.json"
64 # Copy runtime locales
65 cp -r "./src/locale/target" "./dist/locale"