Merge pull request #36802 from brendandburns/i18n

Automatic merge from submit-queue

Begin paths for internationalization in kubectl

This is just the first step, purposely simple so we can get the interface correct.

@kubernetes/sig-cli @deads2k
This commit is contained in:
Kubernetes Submit Queue
2016-12-24 13:09:12 -08:00
committed by GitHub
53 changed files with 3769 additions and 14 deletions

View File

@@ -257,6 +257,7 @@ pkg/util/flushwriter
pkg/util/goroutinemap
pkg/util/hash
pkg/util/homedir
pkg/util/i18n
pkg/util/interrupt
pkg/util/io
pkg/util/json

View File

@@ -130,7 +130,8 @@ def file_extension(filename):
return os.path.splitext(filename)[1].split(".")[-1].lower()
skipped_dirs = ['Godeps', 'third_party', '_gopath', '_output', '.git', 'cluster/env.sh',
"vendor", "test/e2e/generated/bindata.go", "hack/boilerplate/test"]
"vendor", "test/e2e/generated/bindata.go", "hack/boilerplate/test",
"pkg/generated/bindata.go"]
def normalize_files(files):
newfiles = []

View File

@@ -38,6 +38,7 @@ if ! which go-bindata &>/dev/null ; then
exit 5
fi
# These are files for e2e tests.
BINDATA_OUTPUT="${KUBE_ROOT}/test/e2e/generated/bindata.go"
go-bindata -nometadata -prefix "${KUBE_ROOT}" -o "${BINDATA_OUTPUT}.tmp" -pkg generated \
-ignore .jpg -ignore .png -ignore .md \
@@ -59,3 +60,23 @@ else
fi
rm -f "${BINDATA_OUTPUT}.tmp"
# These are files for runtime code
BINDATA_OUTPUT="${KUBE_ROOT}/pkg/generated/bindata.go"
go-bindata -nometadata -prefix "${KUBE_ROOT}" -o "${BINDATA_OUTPUT}.tmp" -pkg generated \
-ignore .jpg -ignore .png -ignore .md \
"${KUBE_ROOT}/translations/..."
gofmt -s -w "${BINDATA_OUTPUT}.tmp"
# Here we compare and overwrite only if different to avoid updating the
# timestamp and triggering a rebuild. The 'cat' redirect trick to preserve file
# permissions of the target file.
if ! cmp -s "${BINDATA_OUTPUT}.tmp" "${BINDATA_OUTPUT}" ; then
cat "${BINDATA_OUTPUT}.tmp" > "${BINDATA_OUTPUT}"
V=2 kube::log::info "Generated bindata file : ${BINDATA_OUTPUT} has $(wc -l ${BINDATA_OUTPUT}) lines of lovely automated artifacts"
else
V=2 kube::log::info "No changes in generated bindata file: ${BINDATA_OUTPUT}"
fi
rm -f "${BINDATA_OUTPUT}.tmp"