kubernetes / minikube

Run Kubernetes locally
https://minikube.sigs.k8s.io/
Apache License 2.0
29.5k stars 4.89k forks source link

fix zh-CN translation #19721

Closed prezha closed 1 month ago

prezha commented 1 month ago

looks like there were additional fileds added unintentionally in pr #19508, which makes the tests fail

@uos-ljtian can you please check and confirm

before

go test ./pkg/minikube/translate -run TestTranslationFilesValid -v

=== RUN   TestTranslationFilesValid
=== RUN   TestTranslationFilesValid/de.json
=== RUN   TestTranslationFilesValid/es.json
=== RUN   TestTranslationFilesValid/fr.json
=== RUN   TestTranslationFilesValid/ja.json
=== RUN   TestTranslationFilesValid/ko.json
=== RUN   TestTranslationFilesValid/pl.json
=== RUN   TestTranslationFilesValid/ru.json
=== RUN   TestTranslationFilesValid/zh-CN.json
    translate_test.go:117: line "Current context is \"{{.context}}\"": "当前的上下文为 \"{{.context}}\"创建 {{.driver_name}} {{.machine_type}}(CPU={{if not .number_of_cpus}}无限制{{else}}{{.number_of_cpus}}{{end}},内存={{if not .memory_size}}无限制{{else}}{{.memory_size}}MB{{end}})..." has mismatching number of variables
        original string variables: [{{.context}}]; translated variables: [{{.context}} {{.driver_name}} {{.machine_type}} {{.memory_size}} {{.number_of_cpus}}]
--- FAIL: TestTranslationFilesValid (0.12s)
    --- PASS: TestTranslationFilesValid/de.json (0.01s)
    --- PASS: TestTranslationFilesValid/es.json (0.01s)
    --- PASS: TestTranslationFilesValid/fr.json (0.04s)
    --- PASS: TestTranslationFilesValid/ja.json (0.03s)
    --- PASS: TestTranslationFilesValid/ko.json (0.01s)
    --- PASS: TestTranslationFilesValid/pl.json (0.00s)
    --- PASS: TestTranslationFilesValid/ru.json (0.00s)
    --- FAIL: TestTranslationFilesValid/zh-CN.json (0.01s)
FAIL
FAIL    k8s.io/minikube/pkg/minikube/translate  0.129s
FAIL

after

go test ./pkg/minikube/translate -run TestTranslationFilesValid -v

=== RUN   TestTranslationFilesValid
=== RUN   TestTranslationFilesValid/de.json
=== RUN   TestTranslationFilesValid/es.json
=== RUN   TestTranslationFilesValid/fr.json
=== RUN   TestTranslationFilesValid/ja.json
=== RUN   TestTranslationFilesValid/ko.json
=== RUN   TestTranslationFilesValid/pl.json
=== RUN   TestTranslationFilesValid/ru.json
=== RUN   TestTranslationFilesValid/zh-CN.json
--- PASS: TestTranslationFilesValid (0.11s)
    --- PASS: TestTranslationFilesValid/de.json (0.02s)
    --- PASS: TestTranslationFilesValid/es.json (0.01s)
    --- PASS: TestTranslationFilesValid/fr.json (0.04s)
    --- PASS: TestTranslationFilesValid/ja.json (0.02s)
    --- PASS: TestTranslationFilesValid/ko.json (0.01s)
    --- PASS: TestTranslationFilesValid/pl.json (0.01s)
    --- PASS: TestTranslationFilesValid/ru.json (0.00s)
    --- PASS: TestTranslationFilesValid/zh-CN.json (0.01s)
PASS
ok      k8s.io/minikube/pkg/minikube/translate  0.122s
k8s-ci-robot commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: prezha

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes/minikube/blob/master/OWNERS)~~ [prezha] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
prezha commented 1 month ago

@spowelljr was faster ;) closing this one as duplicate of #19718