提交 840d2806 编写于 作者: S Shu Muto 提交者: Kubernetes Prow Robot

Add xliffmerge to update translated files (#3991)

To apply differences of `i18n/messages.xlf` into treanslated files,
i.e. `messages.[locale].xlf` like `messages.fr.xlf` and `messages.ja.xlf`,
introduce `xliffmerge` and run it after `ng xi18n`.
上级 9d0b1196
......@@ -39,7 +39,7 @@ RUN curl -sL https://deb.nodesource.com/setup_11.x | bash - \
&& apt-get clean
# Install dependencies. This will take a while.
RUN npm install -g npm@latest gulp@4.0.2 @angular/cli@8.0.3
RUN npm install -g npm@latest gulp@4.0.2 @angular/cli@8.0.3 ngx-i18nsupport
# Set environment variable for JavaScript tests.
ENV CHROME_BIN=/usr/bin/chromium
......
......@@ -26,8 +26,10 @@ echo $MD5_OLD
echo $MD5_NEW
if [ $MD5_OLD != $MD5_NEW ] ; then
echo "i18n/messages.xlf is updated. Commit it too."
git add i18n/messages.xlf
ng xi18n --outFile ../i18n/messages.xlf
xliffmerge
echo "i18n/messages.* files are updated. Commit them too."
git add i18n/messages.*
fi
# Remove extracted file for check
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -42,7 +42,7 @@
"check:frontend:scss": "./aio/scripts/format.sh --styles --check && ./node_modules/sass-lint/bin/sass-lint.js -c .sass-lint.yml 'src/app/frontend/**/*.scss' -v -q",
"check:frontend:html": "./aio/scripts/format.sh --html --check",
"check:license": "gulp check-license-headers",
"check:i18n": "ng xi18n --outFile ../i18n/messages.xlf",
"check:i18n": "ng xi18n --outFile ../i18n/messages.xlf && xliffmerge",
"fix": "concurrently \"npm run fix:backend\" \"npm run fix:frontend\" \"npm run fix:license\" \"npm run fix:i18n\"",
"fix:backend": "golangci-lint run -c .golangci.yml --fix src/app/backend/...",
"fix:frontend": "concurrently \"npm run fix:frontend:ts\" \"npm run fix:frontend:scss\" \"npm run fix:frontend:html\"",
......@@ -50,7 +50,7 @@
"fix:frontend:scss": "scssfmt -r 'src/**/*.scss'",
"fix:frontend:html": "./aio/scripts/format.sh --html",
"fix:license": "gulp update-license-headers",
"fix:i18n": "ng xi18n --outFile ../i18n/messages.xlf",
"fix:i18n": "ng xi18n --outFile ../i18n/messages.xlf && xliffmerge",
"clean": "rm -rf .go_workspace .tmp coverage dist npm-debug.log",
"postversion": "node aio/scripts/version.js",
"postinstall": "node aio/scripts/version.js && ./node_modules/protractor/bin/webdriver-manager update --gecko=false --versions.standalone=3.141.59 && curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.17.1"
......@@ -78,6 +78,16 @@
"git add"
]
},
"xliffmergeOptions": {
"srcDir": "i18n",
"genDir": "i18n",
"defaultLanguage": "en",
"languages": [
"fr",
"ja"
],
"beautifyOutput": true
},
"dependencies": {
"@angular/animations": "8.0.3",
"@angular/cdk": "8.0.2",
......@@ -154,6 +164,7 @@
"lodash": "4.17.11",
"minimatch": "3.0.4",
"minimist": "1.2.0",
"ngx-i18nsupport": "^0.17.1",
"node-gyp": "5.0.2",
"node-sass": "4.12.0",
"protractor": "5.4.1",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册