Merge pull request #102072 from atiratree/i18n

cleanup translations and fix update-translations.sh
This commit is contained in:
Kubernetes Prow Robot 2021-07-06 04:34:18 -07:00 committed by GitHub
commit 1726371f8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 17473 additions and 12698 deletions

View File

@ -22,26 +22,36 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/util.sh"
TRANSLATIONS="staging/src/k8s.io/kubectl/pkg/util/i18n/translations"
KUBECTL_FILES="pkg/kubectl/cmd/*.go pkg/kubectl/cmd/*/*.go"
KUBECTL_FILES=()
KUBECTL_DEFAULT_LOCATIONS=(
"pkg/kubectl/cmd"
"staging/src/k8s.io/kubectl/pkg/cmd"
)
KUBECTL_IGNORE_FILES_REGEX="cmd/kustomize/kustomize.go"
generate_pot="false"
generate_mo="false"
fix_translations="false"
while getopts "hf:xg" opt; do
while getopts "hf:xkg" opt; do
case ${opt} in
h)
echo "$0 [-f files] [-x] [-g]"
echo "$0 [-f files] [-x] [-k] [-g]"
echo " -f <file-path>: Files to process"
echo " -x extract strings to a POT file"
echo " -k fix .po files; deprecate translations by marking them obsolete and supply default messages"
echo " -g sort .po files and generate .mo files"
exit 0
;;
f)
KUBECTL_FILES="${OPTARG}"
KUBECTL_FILES+=("${OPTARG}")
;;
x)
generate_pot="true"
;;
k)
fix_translations="true"
;;
g)
generate_mo="true"
;;
@ -52,6 +62,10 @@ while getopts "hf:xg" opt; do
esac
done
if [[ ${#KUBECTL_FILES} -eq 0 ]]; then
KUBECTL_FILES+=("${KUBECTL_DEFAULT_LOCATIONS[@]}")
fi
if ! which go-xgettext > /dev/null; then
echo 'Can not find go-xgettext, install with:'
echo 'go get github.com/gosexy/gettext/go-xgettext'
@ -66,7 +80,8 @@ fi
if [[ "${generate_pot}" == "true" ]]; then
echo "Extracting strings to POT"
go-xgettext -k=i18n.T "${KUBECTL_FILES}" > tmp.pot
# shellcheck disable=SC2046
go-xgettext -k=i18n.T $(grep -lr "i18n.T" "${KUBECTL_FILES[@]}" | grep -vE "${KUBECTL_IGNORE_FILES_REGEX}") > tmp.pot
perl -pi -e 's/CHARSET/UTF-8/' tmp.pot
perl -pi -e 's/\\\(/\\\\\(/g' tmp.pot
perl -pi -e 's/\\\)/\\\\\)/g' tmp.pot
@ -80,6 +95,23 @@ if [[ "${generate_pot}" == "true" ]]; then
fi
fi
if [[ "${fix_translations}" == "true" ]]; then
echo "Fixing .po files"
kube::util::ensure-temp-dir
for PO_FILE in translations/kubectl/*/LC_MESSAGES/k8s.po; do
TMP="${KUBE_TEMP}/fix.po"
if [[ "${PO_FILE}" =~ .*/default/.* || "${PO_FILE}" =~ .*/en_US/.* ]]; then
# mark obsolete, and set default values for english translations
msgen translations/kubectl/template.pot | \
msgmerge -s --no-fuzzy-matching "${PO_FILE}" - > "${TMP}"
else
# mark obsolete, but do not add untranslated messages
msgmerge -s --no-fuzzy-matching "${PO_FILE}" translations/kubectl/template.pot | msgattrib --translated - > "${TMP}"
fi
mv "${TMP}" "${PO_FILE}"
done
fi
if [[ "${generate_mo}" == "true" ]]; then
echo "Generating .po and .mo files"
for x in "${TRANSLATIONS}"/*/*/*/*.po; do

View File

@ -38,14 +38,14 @@ import (
)
var (
serviceaccountResources = `
replicationcontroller (rc), deployment (deploy), daemonset (ds), job, replicaset (rs), statefulset`
serviceaccountResources = i18n.T(`replicationcontroller (rc), deployment (deploy), daemonset (ds), job, replicaset (rs), statefulset`)
serviceaccountLong = templates.LongDesc(i18n.T(`
Update ServiceAccount of pod template resources.
Possible resources (case insensitive) can be:
` + serviceaccountResources))
`) + serviceaccountResources)
serviceaccountExample = templates.Examples(i18n.T(`
# Set Deployment nginx-deployment's ServiceAccount to serviceaccount1

View File

@ -6,91 +6,108 @@
msgid ""
msgstr ""
"Project-Id-Version: gettext-go-examples-hello\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-12-12 20:03+0000\n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2021-05-17 15:40+0200\n"
"PO-Revision-Date: 2017-01-29 22:54-0800\n"
"Last-Translator: Brendan Burns <brendan.d.burns@gmail.com>\n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.10\n"
"X-Poedit-SourceCharset: UTF-8\n"
"Language-Team: \n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"Language: fr\n"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/apply.go#L98
#: staging/src/k8s.io/kubectl/pkg/cmd/apply/apply.go:173
msgid "Apply a configuration to a resource by filename or stdin"
msgstr ""
"Appliquer une configuration à une ressource par nom de fichier ou depuis "
"stdin"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/delete_cluster.go#L38
#: staging/src/k8s.io/kubectl/pkg/cmd/config/delete_cluster.go:41
#: staging/src/k8s.io/kubectl/pkg/cmd/config/delete_cluster.go:42
msgid "Delete the specified cluster from the kubeconfig"
msgstr "Supprimer le cluster spécifié du kubeconfig"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/delete_context.go#L38
#: staging/src/k8s.io/kubectl/pkg/cmd/config/delete_context.go:41
#: staging/src/k8s.io/kubectl/pkg/cmd/config/delete_context.go:42
msgid "Delete the specified context from the kubeconfig"
msgstr "Supprimer le contexte spécifié du kubeconfig"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/get_contexts.go#L62
#: staging/src/k8s.io/kubectl/pkg/cmd/config/get_contexts.go:72
msgid "Describe one or many contexts"
msgstr "Décrire un ou plusieurs contextes"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/get_clusters.go#L40
#: staging/src/k8s.io/kubectl/pkg/cmd/config/get_clusters.go:41
msgid "Display clusters defined in the kubeconfig"
msgstr "Afficher les cluster définis dans kubeconfig"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/view.go#L64
#: staging/src/k8s.io/kubectl/pkg/cmd/config/view.go:81
msgid "Display merged kubeconfig settings or a specified kubeconfig file"
msgstr ""
"Afficher les paramètres fusionnés de kubeconfig ou d'un fichier kubeconfig "
"spécifié"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/current_context.go#L48
#: staging/src/k8s.io/kubectl/pkg/cmd/config/current_context.go:51
msgid "Displays the current-context"
msgstr "Affiche le contexte actuel"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/config.go#L39
#: staging/src/k8s.io/kubectl/pkg/cmd/config/config.go:42
msgid "Modify kubeconfig files"
msgstr "Modifier des fichiers kubeconfig"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/create_cluster.go#L67
#: staging/src/k8s.io/kubectl/pkg/cmd/config/create_cluster.go:73
msgid "Sets a cluster entry in kubeconfig"
msgstr "Définit un cluster dans kubeconfig"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/create_context.go#L57
#: staging/src/k8s.io/kubectl/pkg/cmd/config/create_context.go:61
msgid "Sets a context entry in kubeconfig"
msgstr "Définit un contexte dans kubeconfig"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/create_authinfo.go#L103
#: staging/src/k8s.io/kubectl/pkg/cmd/config/create_authinfo.go:152
msgid "Sets a user entry in kubeconfig"
msgstr "Définit un utilisateur dans kubeconfig"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/set.go#L59
#: staging/src/k8s.io/kubectl/pkg/cmd/config/set.go:74
msgid "Sets an individual value in a kubeconfig file"
msgstr "Définit une valeur individuelle dans un fichier kubeconfig"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/use_context.go#L48
#: staging/src/k8s.io/kubectl/pkg/cmd/config/use_context.go:51
msgid "Sets the current-context in a kubeconfig file"
msgstr "Définit le contexte courant dans un fichier kubeconfig"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/unset.go#L47
#: staging/src/k8s.io/kubectl/pkg/cmd/config/unset.go:59
msgid "Unsets an individual value in a kubeconfig file"
msgstr "Supprime une valeur individuelle dans un fichier kubeconfig"
#: staging/src/k8s.io/kubectl/pkg/cmd/annotate/annotate.go:134
msgid "Update the annotations on a resource"
msgstr "Mettre à jour les annotations d'une ressource"
msgid ""
"watch is only supported on individual resources and resource collections - "
"%d resources were found"
msgid_plural ""
"watch is only supported on individual resources and resource collections - "
"%d resources were found"
msgstr[0] ""
"watch n'est compatible qu'avec les ressources individuelles et les "
"collections de ressources. - %d ressource a été trouvée. "
msgstr[1] ""
"watch n'est compatible qu'avec les ressources individuelles et les "
"collections de ressources. - %d ressources ont été trouvées. "
#~ msgid ""
#~ "watch is only supported on individual resources and resource collections "
#~ "- %d resources were found"
#~ msgid_plural ""
#~ "watch is only supported on individual resources and resource collections "
#~ "- %d resources were found"
#~ msgstr[0] ""
#~ "watch n'est compatible qu'avec les ressources individuelles et les "
#~ "collections de ressources. - %d ressource a été trouvée. "
#~ msgstr[1] ""
#~ "watch n'est compatible qu'avec les ressources individuelles et les "
#~ "collections de ressources. - %d ressources ont été trouvées. "

View File

@ -6,84 +6,101 @@
msgid ""
msgstr ""
"Project-Id-Version: gettext-go-examples-hello\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-12-12 20:03+0000\n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2021-05-17 15:40+0200\n"
"PO-Revision-Date: 2018-04-03 06:05+0900\n"
"Last-Translator: Ian Y. Choi <ianyrchoi@gmail.com>\n"
"Language-Team: \n"
"Language: ko_KR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.6\n"
"X-Poedit-SourceCharset: UTF-8\n"
"Language-Team: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
"Language: ko_KR\n"
# https://github.com/kubernetes/kubernetes/blob/masterpkg/kubectl/cmd/apply.go#L98
#: staging/src/k8s.io/kubectl/pkg/cmd/apply/apply.go:173
msgid "Apply a configuration to a resource by filename or stdin"
msgstr "구성을 파일 이름 또는 stdin에 의한 자원에 적용합니다"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/delete_cluster.go#L38
#: staging/src/k8s.io/kubectl/pkg/cmd/config/delete_cluster.go:41
#: staging/src/k8s.io/kubectl/pkg/cmd/config/delete_cluster.go:42
msgid "Delete the specified cluster from the kubeconfig"
msgstr "kubeconfig에서 지정된 클러스터를 삭제합니다"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/delete_context.go#L38
#: staging/src/k8s.io/kubectl/pkg/cmd/config/delete_context.go:41
#: staging/src/k8s.io/kubectl/pkg/cmd/config/delete_context.go:42
msgid "Delete the specified context from the kubeconfig"
msgstr "kubeconfig에서 지정된 컨텍스트를 삭제합니다"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/get_contexts.go#L62
#: staging/src/k8s.io/kubectl/pkg/cmd/config/get_contexts.go:72
msgid "Describe one or many contexts"
msgstr "하나 또는 여러 컨텍스트를 설명합니다"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/get_clusters.go#L40
#: staging/src/k8s.io/kubectl/pkg/cmd/config/get_clusters.go:41
msgid "Display clusters defined in the kubeconfig"
msgstr "kubeconfig에 정의된 클러스터를 표시합니다"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/view.go#L64
#: staging/src/k8s.io/kubectl/pkg/cmd/config/view.go:81
msgid "Display merged kubeconfig settings or a specified kubeconfig file"
msgstr "병합된 kubeconfig 설정 또는 지정된 kubeconfig 파일을 표시합니다"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/current_context.go#L48
#: staging/src/k8s.io/kubectl/pkg/cmd/config/current_context.go:51
msgid "Displays the current-context"
msgstr "현재-컨텍스트를 표시합니다"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/config.go#L39
#: staging/src/k8s.io/kubectl/pkg/cmd/config/config.go:42
msgid "Modify kubeconfig files"
msgstr "kubeconfig 파일을 수정합니다"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/create_cluster.go#L67
#: staging/src/k8s.io/kubectl/pkg/cmd/config/create_cluster.go:73
msgid "Sets a cluster entry in kubeconfig"
msgstr "kubeconfig에서 클러스터 항목을 설정합니다"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/create_context.go#L57
#: staging/src/k8s.io/kubectl/pkg/cmd/config/create_context.go:61
msgid "Sets a context entry in kubeconfig"
msgstr "kubeconfig에서 컨텍스트 항목을 설정합니다"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/create_authinfo.go#L103
#: staging/src/k8s.io/kubectl/pkg/cmd/config/create_authinfo.go:152
msgid "Sets a user entry in kubeconfig"
msgstr "kubeconfig에서 사용자 항목을 설정합니다"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/set.go#L59
#: staging/src/k8s.io/kubectl/pkg/cmd/config/set.go:74
msgid "Sets an individual value in a kubeconfig file"
msgstr "kubeconfig 파일에서 단일값을 설정합니다"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/use_context.go#L48
#: staging/src/k8s.io/kubectl/pkg/cmd/config/use_context.go:51
msgid "Sets the current-context in a kubeconfig file"
msgstr "kubeconfig 파일에서 현재-컨텍스트를 설정합니다"
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/config/unset.go#L47
#: staging/src/k8s.io/kubectl/pkg/cmd/config/unset.go:59
msgid "Unsets an individual value in a kubeconfig file"
msgstr "kubeconfig 파일에서 단일값 설정을 해제합니다"
#: staging/src/k8s.io/kubectl/pkg/cmd/annotate/annotate.go:134
msgid "Update the annotations on a resource"
msgstr "자원에 대한 주석을 업데이트합니다"
msgid ""
"watch is only supported on individual resources and resource collections - "
"%d resources were found"
msgid_plural ""
"watch is only supported on individual resources and resource collections - "
"%d resources were found"
msgstr[0] ""
"watch는 단일 리소스와 리소스 모음만을 지원합니다 - %d 개 자원을 발견하였습"
"니다"
#~ msgid ""
#~ "watch is only supported on individual resources and resource collections "
#~ "- %d resources were found"
#~ msgid_plural ""
#~ "watch is only supported on individual resources and resource collections "
#~ "- %d resources were found"
#~ msgstr[0] ""
#~ "watch는 단일 리소스와 리소스 모음만을 지원합니다 - %d 개 자원을 발견하였습"
#~ "니다"

View File

@ -6,84 +6,86 @@
msgid ""
msgstr ""
"Project-Id-Version: hello-world\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-26 08:28+0800\n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2021-05-17 15:40+0200\n"
"PO-Revision-Date: 2017-06-02 09:13+0800\n"
"Last-Translator: William Chang <warmchang@outlook.com>\n"
"Language-Team: \n"
"Language: zh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.2\n"
"X-Poedit-SourceCharset: UTF-8\n"
"Language-Team: \n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"Language: zh\n"
#: pkg/kubectl/cmd/apply.go:104
#: staging/src/k8s.io/kubectl/pkg/cmd/apply/apply.go:173
msgid "Apply a configuration to a resource by filename or stdin"
msgstr "通過檔案名或標準輸入流(stdin)對資源進行配置"
#: pkg/kubectl/cmd/config/delete_cluster.go:39
#: staging/src/k8s.io/kubectl/pkg/cmd/config/delete_cluster.go:41
#: staging/src/k8s.io/kubectl/pkg/cmd/config/delete_cluster.go:42
msgid "Delete the specified cluster from the kubeconfig"
msgstr "刪除 kubeconfig 檔案中指定的叢集(cluster)"
#: pkg/kubectl/cmd/config/delete_context.go:39
#: staging/src/k8s.io/kubectl/pkg/cmd/config/delete_context.go:41
#: staging/src/k8s.io/kubectl/pkg/cmd/config/delete_context.go:42
msgid "Delete the specified context from the kubeconfig"
msgstr "刪除 kubeconfig 檔案中指定的 context"
#: pkg/kubectl/cmd/config/get_contexts.go:64
#: staging/src/k8s.io/kubectl/pkg/cmd/config/get_contexts.go:72
msgid "Describe one or many contexts"
msgstr "描述一個或多個 context"
#: pkg/kubectl/cmd/config/get_clusters.go:41
#: staging/src/k8s.io/kubectl/pkg/cmd/config/get_clusters.go:41
msgid "Display clusters defined in the kubeconfig"
msgstr "顯示 kubeconfig 檔案中定義的叢集(cluster)"
#: pkg/kubectl/cmd/config/view.go:67
#: staging/src/k8s.io/kubectl/pkg/cmd/config/view.go:81
msgid "Display merged kubeconfig settings or a specified kubeconfig file"
msgstr "顯示合併的 kubeconfig 配置或一個指定的 kubeconfig 檔案"
#: pkg/kubectl/cmd/config/current_context.go:49
#: staging/src/k8s.io/kubectl/pkg/cmd/config/current_context.go:51
msgid "Displays the current-context"
msgstr "顯示目前的 context"
#: pkg/kubectl/cmd/config/config.go:40
#: staging/src/k8s.io/kubectl/pkg/cmd/config/config.go:42
msgid "Modify kubeconfig files"
msgstr "修改 kubeconfig 檔案"
#: pkg/kubectl/cmd/config/create_cluster.go:68
#: staging/src/k8s.io/kubectl/pkg/cmd/config/create_cluster.go:73
msgid "Sets a cluster entry in kubeconfig"
msgstr "設置 kubeconfig 檔案中的一個叢集(cluster)條目"
#: pkg/kubectl/cmd/config/create_context.go:58
#: staging/src/k8s.io/kubectl/pkg/cmd/config/create_context.go:61
msgid "Sets a context entry in kubeconfig"
msgstr "設置 kubeconfig 檔案中的一個 context 條目"
#: pkg/kubectl/cmd/config/create_authinfo.go:104
#: staging/src/k8s.io/kubectl/pkg/cmd/config/create_authinfo.go:152
msgid "Sets a user entry in kubeconfig"
msgstr "設置 kubeconfig 檔案中的一個使用者條目"
#: pkg/kubectl/cmd/config/set.go:60
#: staging/src/k8s.io/kubectl/pkg/cmd/config/set.go:74
msgid "Sets an individual value in a kubeconfig file"
msgstr "設置 kubeconfig 檔案中的一個值"
#: pkg/kubectl/cmd/config/use_context.go:49
#: staging/src/k8s.io/kubectl/pkg/cmd/config/use_context.go:51
msgid "Sets the current-context in a kubeconfig file"
msgstr "設置 kubeconfig 檔案中的目前 context"
#: pkg/kubectl/cmd/config/unset.go:48
#: staging/src/k8s.io/kubectl/pkg/cmd/config/unset.go:59
msgid "Unsets an individual value in a kubeconfig file"
msgstr "取消設置 kubeconfig 檔案中的一個值"
#: pkg/kubectl/cmd/annotate.go:116
#: staging/src/k8s.io/kubectl/pkg/cmd/annotate/annotate.go:134
msgid "Update the annotations on a resource"
msgstr "更新一個資源的注解(annotations)"
msgid ""
"watch is only supported on individual resources and resource collections - "
"%d resources were found"
msgid_plural ""
"watch is only supported on individual resources and resource collections - "
"%d resources were found"
msgstr[0] "一次只能 watch 一個資源或資料集合 - 找到了 %d 個資源"
msgstr[1] "一次只能 watch 一個資源或資料集合 - 找到了 %d 個資源"
#~ msgid ""
#~ "watch is only supported on individual resources and resource collections "
#~ "- %d resources were found"
#~ msgid_plural ""
#~ "watch is only supported on individual resources and resource collections "
#~ "- %d resources were found"
#~ msgstr[0] "一次只能 watch 一個資源或資料集合 - 找到了 %d 個資源"
#~ msgstr[1] "一次只能 watch 一個資源或資料集合 - 找到了 %d 個資源"