Merge pull request #7287 from kubernetes/sharifelgamal-patch-4

More translation documentation updates
pull/7292/head
Sharif Elgamal 2020-03-27 10:30:22 -07:00 committed by GitHub
commit 6c4448381c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 13 deletions

View File

@ -12,7 +12,7 @@ All translations are stored in the top-level `translations` directory.
* Add a new json file in the translations directory with the locale code of the language you want to add * Add a new json file in the translations directory with the locale code of the language you want to add
translations for, e.g. fr for French. translations for, e.g. fr for French.
``` ```
~/minikube$ touch translations/ar.json ~/minikube$ touch translations/fr.json
~/minikube$ ls translations/ ~/minikube$ ls translations/
de.json es.json fr.json ja.json ko.json pl.json zh-CN.json de.json es.json fr.json ja.json ko.json pl.json zh-CN.json
``` ```
@ -31,8 +31,7 @@ All translations are stored in the top-level `translations` directory.
Writing to zh-CN.json Writing to zh-CN.json
Done! Done!
``` ```
* Add translated strings as the value of the map where the English phrase is the key. * Add translated strings to the json file as the value of the map where the English phrase is the key.
* The file will be json file with all of the English phrases as the keys of a map
``` ```
~/minikube$ head translations/fr.json ~/minikube$ head translations/fr.json
{ {
@ -47,21 +46,24 @@ All translations are stored in the top-level `translations` directory.
``` ```
* Add the translations as the values of the map, keeping in mind that anything in double braces `{{}}` are variable names describing what gets injected and should not be translated. * Add the translations as the values of the map, keeping in mind that anything in double braces `{{}}` are variable names describing what gets injected and should not be translated.
``` ```
~/minikube$ vi translations/ar.json ~/minikube$ vi translations/fr.json
{ {
"\"The '{{.minikube_addon}}' addon is disabled": "", [...]
"\"{{.machineName}}\" does not exist, nothing to stop": "\""{{.machineName}} n'exist pas, rien a arrêter.", "Amount of time to wait for a service in seconds": "",
"\"{{.name}}\" profile does not exist, trying anyways.": "", "Amount of time to wait for service in seconds": "",
"'none' driver does not support 'minikube docker-env' command": "", "Another hypervisor, such as VirtualBox, is conflicting with KVM. Please stop the other hypervisor, or use --driver to switch to it.": "",
"'none' driver does not support 'minikube mount' command": "", "Automatically selected the {{.driver}} driver": "Choix automatique du driver {{.driver}}",
"'none' driver does not support 'minikube podman-env' command": "", "Automatically selected the {{.driver}} driver. Other choices: {{.alternates}}": "Choix automatique du driver {{.driver}}. Autres choix: {{.alternatives}}",
"'none' driver does not support 'minikube ssh' command": "", "Available Commands": "",
"'{{.driver}}' driver reported an issue: {{.error}}": "", "Basic Commands:": "",
"Because you are using docker driver on Mac, the terminal needs to be open to run it.": "",
[...]
}
``` ```
### Adding Translations To an Existing Language ### Adding Translations To an Existing Language
* Run `make extract` to make sure all strings are up to date * Run `make extract` to make sure all strings are up to date
* Edit the appropriate json file in the 'translations' directory, in the same way described above. * Edit the appropriate json file in the 'translations' directory, in the same way as described above.
### Testing translations ### Testing translations
* Once you have all the translations you want, save the file and rebuild the minikube from scratch to pick up your new translations: * Once you have all the translations you want, save the file and rebuild the minikube from scratch to pick up your new translations: