i18n: Fix bug where package-level variables are not translated.

Change i18n.T() to load translations if they have not yet been loaded.

Added new integration tests to test help output translation.
This commit is contained in:
Brian Pursley
2022-11-29 23:09:57 -05:00
parent 3f823c0daa
commit c0dea5e31a
5 changed files with 256 additions and 8 deletions

View File

@@ -45,6 +45,7 @@ source "${KUBE_ROOT}/test/cmd/events.sh"
source "${KUBE_ROOT}/test/cmd/exec.sh"
source "${KUBE_ROOT}/test/cmd/generic-resources.sh"
source "${KUBE_ROOT}/test/cmd/get.sh"
source "${KUBE_ROOT}/test/cmd/help.sh"
source "${KUBE_ROOT}/test/cmd/kubeconfig.sh"
source "${KUBE_ROOT}/test/cmd/node-management.sh"
source "${KUBE_ROOT}/test/cmd/plugins.sh"
@@ -555,6 +556,12 @@ runTests() {
record_command run_kubectl_get_tests
fi
################
# Kubectl help #
################
record_command run_kubectl_help_tests
##################
# Kubectl events #
##################