mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-02-18 18:28:18 -05:00
i18n: Fix bug where package-level variables are not translated.
The call to `i18n.LoadTranslations` needs to occur on init so that package-level variables that call `i18n.T()` to initialize their values will be able to receive the translated string. Added new integration tests to test help output translation.
This commit is contained in:
parent
3f823c0daa
commit
34d980e770
2 changed files with 384 additions and 308 deletions
|
|
@ -83,8 +83,7 @@ if [[ "${generate_pot}" == "true" ]]; then
|
|||
# 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
|
||||
perl -pi -e 's/\\(?!n"\n|")/\\\\/g' tmp.pot
|
||||
kube::util::ensure-temp-dir
|
||||
if msgcat -s tmp.pot > "${KUBE_TEMP}/template.pot"; then
|
||||
mv "${KUBE_TEMP}/template.pot" "${TRANSLATIONS}/kubectl/template.pot"
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue