提交 639f1e77 编写于 作者: S Shu Muto 提交者: Kubernetes Prow Robot

Transfer authority for translation files to each i18n team. (#4283)

Separate directories for each translation files and put OWNERS file into them.
上级 b910597e
......@@ -33,14 +33,14 @@ function build::frontend {
mkdir -p ${FRONTEND_DIR}/en
${NG_BIN} build --aot --prod --outputPath=${TMP_DIR}/frontend/en
languages=($(ls i18n | awk -F"." '{if (NF>2) print $2}'))
languages=($(find i18n/* -type d|cut -d"/" -f2))
for language in "${languages[@]}"; do
mkdir -p ${FRONTEND_DIR}/${language}
say "Building frontend for locale: ${language}"
${NG_BIN} build --aot \
--prod \
--i18nFile=${I18N_DIR}/messages.${language}.xlf \
--i18nFile=${I18N_DIR}/${language}/messages.${language}.xlf \
--i18nFormat=xlf \
--i18nLocale=${language} --outputPath=${TMP_DIR}/frontend/${language}
done
......
......@@ -22,14 +22,11 @@ ng xi18n --outFile ../i18n/messages.new.xlf
MD5_OLD=$(md5sum i18n/messages.xlf | cut -c -32)
MD5_NEW=$(md5sum i18n/messages.new.xlf | cut -c -32)
echo $MD5_OLD
echo $MD5_NEW
if [ $MD5_OLD != $MD5_NEW ] ; then
ng xi18n --outFile ../i18n/messages.xlf
xliffmerge
mv i18n/messages.new.xlf i18n/messages.xlf
aio/scripts/xliffmerge.sh
echo "i18n/messages.* files are updated. Commit them too."
git add i18n/messages.*
git add i18n
fi
# Remove extracted file for check
......
#!/usr/bin/env bash
# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Collect current localized files
languages=($(find i18n/* -type d|cut -d"/" -f2))
for language in "${languages[@]}"; do
mv i18n/${language}/messages.${language}.xlf i18n
done
# Merge generated messages file into localized files.
xliffmerge
# Deliver merged localized files into each locale directories.
for language in "${languages[@]}"; do
mv i18n/messages.${language}.xlf i18n/${language}
done
approvers:
- feloy
approvers:
- shu-mutou
approvers:
- seokho-son
......@@ -43,7 +43,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 && xliffmerge",
"check:i18n": "ng xi18n --outFile ../i18n/messages.xlf && aio/scripts/xliffmerge.sh",
"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\"",
......@@ -51,7 +51,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 && xliffmerge",
"fix:i18n": "ng xi18n --outFile ../i18n/messages.xlf && aio/scripts/xliffmerge.sh",
"clean": "rm -rf .go_workspace .tmp coverage dist npm-debug.log",
"postversion": "node aio/scripts/version.js",
"postinstall": "node aio/scripts/version.js && command -v golangci-lint >/dev/null 2>&1 || { curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.17.1; } && go mod download"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册