initial commit for extracting advice strings

pull/4724/head
Sharif Elgamal 2019-07-09 15:48:26 -07:00
parent fc5c01b1f4
commit fc9fc7eecd
No known key found for this signature in database
GPG Key ID: 23CC0225BD9FD702
3 changed files with 120 additions and 8 deletions

View File

@ -168,6 +168,11 @@ func inspectFile(e *state) error {
return err
}
if strings.HasSuffix(e.filename, "err_map.go") {
extractAdvice(file, e)
return nil
}
ast.Inspect(file, func(x ast.Node) bool {
if fi, ok := x.(*ast.File); ok {
e.currentPackage = fi.Name.String()
@ -389,3 +394,20 @@ func addParentFuncToList(e *state) {
e.fs.Push(e.parentFunc)
}
}
// extractAdvice specifically extracts Advice strings in err_map.go, since they don't conform to our normal translatable string format.
func extractAdvice(file *ast.File, e *state) {
ast.Inspect(file, func(x ast.Node) bool {
if kvp, ok := x.(*ast.KeyValueExpr); ok {
if i, ok := kvp.Key.(*ast.Ident); ok {
if i.Name == "Advice" {
// At this point we know the value to the kv pair is guaranteed to be a string
advice, _ := kvp.Value.(*ast.BasicLit)
addStringToList(advice.Value, e)
}
}
}
return true
})
}

View File

@ -16,15 +16,24 @@
"'none' driver does not support 'minikube docker-env' command": "",
"'none' driver does not support 'minikube mount' command": "",
"'none' driver does not support 'minikube ssh' command": "",
"A firewall is blocking Docker within the minikube VM from reaching the internet. You may need to configure it to use a proxy.": "",
"A firewall is interfering with minikube's ability to make outgoing HTTPS requests. You may need to change the value of the HTTPS_PROXY environment variable.": "",
"A firewall is likely blocking minikube from reaching the internet. You may need to configure minikube to use a proxy.": "",
"Advice: %s": "",
"Alternatively, you may delete the existing VM using `minikube delete -p %s`": "",
"Cannot find directory %s for mount": "",
"Check that minikube is running and that you have specified the correct namespace (-n flag) if required.": "",
"Check that your --kubernetes-version has a leading 'v'. For example: 'v1.1.14'": "",
"Configure an external network switch following the official documentation, then add `--hyperv-virtual-switch=\u003cswitch-name\u003e` to `minikube start`": "",
"Configuring environment for Kubernetes %s on %s %s": "Configurant l'environment pour Kubernetes %s sur %s %s",
"Configuring local host environment ...": "",
"Creating %s VM (CPUs=%d, Memory=%dMB, Disk=%dMB) ...": "Créant un VM %s (CPUs=%d, Mémoire=%dMB, Disque=%dMB)",
"Creating mount %s ...": "",
"Deleting %q from %s ...": "",
"Disable Hyper-V when you want to run VirtualBox to boot the VM": "",
"Disable dynamic memory in your VM manager, or pass in a larger --memory value": "",
"Disable real-time anti-virus software, reboot, and reinstall VirtualBox if the problem continues.": "",
"Docker inside the VM is unavailable. Try running 'minikube delete' to reset the VM.": "",
"Documentation: %s": "",
"Done! kubectl is now configured to use %q": "Fini! kubectl est maintenant configuré pour utiliser %s.",
"Download complete!": "",
@ -34,6 +43,7 @@
"ERROR creating `registry-creds-ecr` secret: %v": "",
"ERROR creating `registry-creds-gcr` secret: %v": "",
"Enabling dashboard ...": "",
"Error checking driver version: %v": "",
"Error creating list template": "",
"Error creating minikube directory": "",
"Error creating status template": "",
@ -61,6 +71,8 @@
"Error killing mount process": "",
"Error loading api": "",
"Error opening service": "",
"Error parsing minukube version: %v": "",
"Error parsing vmDriver version: %v": "",
"Error reading %s: %v": "",
"Error restarting cluster": "",
"Error setting shell variables": "",
@ -104,8 +116,15 @@
"For more information, see:": "",
"Found network options:": "",
"GID: %s": "",
"Have you set up libvirt correctly?": "",
"If the above advice does not help, please let us know: ": "",
"If using the none driver, ensure that systemctl is installed": "",
"Ignoring --vm-driver=%s, as the existing %q VM was created using the %s driver.": "",
"In some environments, this message is incorrect. Try 'minikube start --no-vtx-check'": "",
"Install VirtualBox, ensure that VBoxManage is executable and in path, or select an alternative value for --vm-driver": "",
"Install the latest kvm2 driver and run 'virt-host-validate'": "",
"Install the latest minikube hyperkit driver, and run 'minikube delete'": "",
"Invalid size passed in argument: %v": "",
"IsEnabled failed": "",
"Kubernetes downgrade is not supported, will continue to use %v": "",
"Launching Kubernetes ... ": "Lançant Kubernetes ...",
@ -120,33 +139,53 @@
"Opening %s in your default browser...": "",
"Opening kubernetes service %s/%s in default browser...": "",
"Options: %s": "",
"Please don't run minikube as root or with 'sudo' privileges. It isn't necessary.": "",
"Please check your BIOS, and ensure that you are running without HyperV or other nested virtualization that may interfere": "",
"Please don't run minikube as root or with 'sudo' privileges. It isn't necessary with %s driver.": "",
"Please enter a value:": "",
"Please install the minikube kvm2 VM driver, or select an alternative --vm-driver": "",
"Please make sure the service you are looking for is deployed or is in the correct namespace.": "",
"Please run with sudo. the vm-driver %q requires sudo.": "",
"Please specify the directory to be mounted: \n\tminikube mount \u003csource directory\u003e:\u003ctarget directory\u003e (example: \"/host-home:/vm-home\")": "",
"Please upgrade the 'docker-machine-driver-kvm2'. %s": "",
"Powering off %q via SSH ...": "",
"Problems detected in %q:": "",
"Pulling images ...": "Extrayant les images ... ",
"Re-run 'minikube start' with --alsologtostderr -v=8 to see the VM driver error message": "",
"Re-using the currently running %s VM for %q ...": "",
"Reboot to complete VirtualBox installation, and verify that VirtualBox is not blocked by your system": "",
"Rebuild libvirt with virt-network support": "",
"Reinstall VirtualBox and verify that it is not blocked: System Preferences -\u003e Security \u0026 Privacy -\u003e General -\u003e Some system software was blocked from loading": "",
"Related issues:": "",
"Relaunching Kubernetes %s using %s ... ": "",
"Requested disk size (%dMB) is less than minimum of %dMB": "",
"Requested disk size (%dMB) is less than minimum of (%dMB)": "",
"Requested memory allocation (%dMB) is less than the default memory allocation of (%dMB). Beware that Minikube might not work correctly or crash unexpectedly.": "",
"Requested memory allocation (%dMB) is less than the minimum allowed of %dMB": "",
"Restarting existing %s VM for %q ...": "",
"Run 'minikube delete' to delete the stale VM": "",
"Run 'minikube delete'. If the problem persists, check your proxy or firewall configuration": "",
"Run 'sudo modprobe vboxdrv' and reinstall VirtualBox if it fails.": "",
"Run minikube from the C: drive.": "",
"Set failed": "",
"Setting profile failed": "",
"Skipped switching kubectl context for %s , because --keep-context": "",
"Sorry that minikube crashed. If this was unexpected, we would love to hear from you:": "",
"Sorry, completion support is not yet implemented for %q": "",
"Sorry, the --gpu feature is currently only supported with --vm-driver=kvm2": "",
"Sorry, the --hidden feature is currently only supported with --vm-driver=kvm2": "",
"Sorry, the kubeadm.%s parameter is currently not supported by --extra-config": "",
"Sorry, url provided with --registry-mirror flag is invalid %q": "",
"Specify --kubernetes-version in v\u003cmajor\u003e.\u003cminor.\u003cbuild\u003e form. example: 'v1.1.14'": "",
"Specify an alternate --host-only-cidr value, such as 172.16.0.1/24": "",
"Stopping %q in %s ...": "",
"Successfully mounted %s to %s": "",
"Target directory %q must be an absolute path": "",
"The %q cluster has been deleted.": "",
"The 'docker-machine-driver-kvm2' version is old. Please consider upgrading. %s": "",
"The 'none' driver provides limited isolation and may reduce system security and reliability.": "",
"The KVM driver is unable to resurrect this old VM. Please run `minikube delete` to delete it and try again.": "",
"The VM driver exited with an error, and may be corrupt. Run 'minikube start' with --alsologtostderr -v=8 to see the error": "",
"The docker host is currently not running": "",
"The docker service is currently not active": "",
"The kvm driver is deprecated and support for it will be removed in a future release.\n\t\t\t\tPlease consider switching to the kvm2 driver, which is intended to replace the kvm driver.\n\t\t\t\tSee https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver for more information.\n\t\t\t\tTo disable this message, run [minikube config set ShowDriverDeprecationNotification false]": "",
"The minikube VM is offline. Please run 'minikube start' to start it again.": "",
"The value passed to --format is invalid": "",
"The value passed to --format is invalid: %s": "",
"The vmwarefusion driver is deprecated and support for it will be removed in a future release.\n\t\t\t\tPlease consider switching to the new vmware unified driver, which is intended to replace the vmwarefusion driver.\n\t\t\t\tSee https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#vmware-unified-driver for more information.\n\t\t\t\tTo disable this message, run [minikube config set ShowDriverDeprecationNotification false]": "",
@ -177,9 +216,11 @@
"Uninstalling Kubernetes %s using %s ...": "",
"Unmounting %s ...": "",
"Update server returned an empty list": "",
"Upgrade to QEMU v3.1.0+, run 'virt-host-validate', or ensure that you are not running in a nested VM environment.": "",
"Usage: minikube completion SHELL": "",
"Userspace file server is shutdown": "",
"Userspace file server: ": "",
"Verify that your HTTP_PROXY and HTTPS_PROXY environment variables are set correctly.": "",
"Verifying dashboard health ...": "",
"Verifying proxy health ...": "",
"Verifying:": "Vérifiant:",
@ -189,6 +230,8 @@
"Waiting for SSH access ...": "Attendant l'accès SSH ...",
"You appear to be using a proxy, but your NO_PROXY environment does not include the minikube IP (%s). Please see https://github.com/kubernetes/minikube/blob/master/docs/http_proxy.md for more details": "",
"You must specify a service name": "",
"Your host does not support KVM virtualization. Ensure that qemu-kvm is installed, and run 'virt-host-validate' to debug the problem": "",
"Your host is failing to route packets to the minikube VM. If you have VPN software, try turning it off or configuring it so that it does not re-route traffic to the VM IP. If not, check your VM environment routing options.": "",
"addon '%s' is currently not enabled.\nTo enable this addon run:\nminikube addons enable %s": "",
"addon '%s' is not a valid addon packaged with minikube.\nTo see the list of available addons run:\nminikube addons list": "",
"addon list failed": "",
@ -211,12 +254,14 @@
"logdir set failed": "",
"minikube %s on %s (%s)": "minikube %s sur %s (%s)",
"minikube is not running, so the service cannot be accessed": "",
"minikube is unable to access the Google Container Registry. You may need to configure it to use a HTTP proxy.": "",
"minikube profile was successfully set to %s": "",
"minikube will upgrade the local cluster from Kubernetes %s to %s": "",
"mount argument %q must be in form: \u003csource directory\u003e:\u003ctarget directory\u003e": "",
"mount failed": "",
"need to relocate them. For example, to overwrite your own settings:": "",
"opt %s": "",
"service %s/%s has no node port": "",
"stat failed": "",
"unable to bind flags": "",
"unable to set logtostderr": "",

View File

@ -16,15 +16,24 @@
"'none' driver does not support 'minikube docker-env' command": "",
"'none' driver does not support 'minikube mount' command": "",
"'none' driver does not support 'minikube ssh' command": "",
"A firewall is blocking Docker within the minikube VM from reaching the internet. You may need to configure it to use a proxy.": "",
"A firewall is interfering with minikube's ability to make outgoing HTTPS requests. You may need to change the value of the HTTPS_PROXY environment variable.": "",
"A firewall is likely blocking minikube from reaching the internet. You may need to configure minikube to use a proxy.": "",
"Advice: %s": "",
"Alternatively, you may delete the existing VM using `minikube delete -p %s`": "",
"Cannot find directory %s for mount": "",
"Check that minikube is running and that you have specified the correct namespace (-n flag) if required.": "",
"Check that your --kubernetes-version has a leading 'v'. For example: 'v1.1.14'": "",
"Configure an external network switch following the official documentation, then add `--hyperv-virtual-switch=\u003cswitch-name\u003e` to `minikube start`": "",
"Configuring environment for Kubernetes %s on %s %s": "开始为Kubernetes %s%s %s 配置环境变量",
"Configuring local host environment ...": "",
"Creating %s VM (CPUs=%d, Memory=%dMB, Disk=%dMB) ...": "正在创建%s虚拟机CPU=%d内存=%dMB磁盘=%dMB...",
"Creating mount %s ...": "",
"Deleting %q from %s ...": "",
"Disable Hyper-V when you want to run VirtualBox to boot the VM": "",
"Disable dynamic memory in your VM manager, or pass in a larger --memory value": "",
"Disable real-time anti-virus software, reboot, and reinstall VirtualBox if the problem continues.": "",
"Docker inside the VM is unavailable. Try running 'minikube delete' to reset the VM.": "",
"Documentation: %s": "",
"Done! kubectl is now configured to use %q": "完成kubectl已经配置至%q",
"Download complete!": "",
@ -34,6 +43,7 @@
"ERROR creating `registry-creds-ecr` secret: %v": "",
"ERROR creating `registry-creds-gcr` secret: %v": "",
"Enabling dashboard ...": "",
"Error checking driver version: %v": "",
"Error creating list template": "",
"Error creating minikube directory": "",
"Error creating status template": "",
@ -61,6 +71,8 @@
"Error killing mount process": "",
"Error loading api": "",
"Error opening service": "",
"Error parsing minukube version: %v": "",
"Error parsing vmDriver version: %v": "",
"Error reading %s: %v": "",
"Error restarting cluster": "",
"Error setting shell variables": "",
@ -104,8 +116,15 @@
"For more information, see:": "",
"Found network options:": "",
"GID: %s": "",
"Have you set up libvirt correctly?": "",
"If the above advice does not help, please let us know: ": "",
"If using the none driver, ensure that systemctl is installed": "",
"Ignoring --vm-driver=%s, as the existing %q VM was created using the %s driver.": "",
"In some environments, this message is incorrect. Try 'minikube start --no-vtx-check'": "",
"Install VirtualBox, ensure that VBoxManage is executable and in path, or select an alternative value for --vm-driver": "",
"Install the latest kvm2 driver and run 'virt-host-validate'": "",
"Install the latest minikube hyperkit driver, and run 'minikube delete'": "",
"Invalid size passed in argument: %v": "",
"IsEnabled failed": "",
"Kubernetes downgrade is not supported, will continue to use %v": "",
"Launching Kubernetes ... ": "正在启动 Kubernetes ... ",
@ -120,33 +139,53 @@
"Opening %s in your default browser...": "",
"Opening kubernetes service %s/%s in default browser...": "",
"Options: %s": "",
"Please don't run minikube as root or with 'sudo' privileges. It isn't necessary.": "",
"Please check your BIOS, and ensure that you are running without HyperV or other nested virtualization that may interfere": "",
"Please don't run minikube as root or with 'sudo' privileges. It isn't necessary with %s driver.": "",
"Please enter a value:": "",
"Please install the minikube kvm2 VM driver, or select an alternative --vm-driver": "",
"Please make sure the service you are looking for is deployed or is in the correct namespace.": "",
"Please run with sudo. the vm-driver %q requires sudo.": "",
"Please specify the directory to be mounted: \n\tminikube mount \u003csource directory\u003e:\u003ctarget directory\u003e (example: \"/host-home:/vm-home\")": "",
"Please upgrade the 'docker-machine-driver-kvm2'. %s": "",
"Powering off %q via SSH ...": "",
"Problems detected in %q:": "",
"Pulling images ...": "拉取镜像 ...",
"Re-run 'minikube start' with --alsologtostderr -v=8 to see the VM driver error message": "",
"Re-using the currently running %s VM for %q ...": "",
"Reboot to complete VirtualBox installation, and verify that VirtualBox is not blocked by your system": "",
"Rebuild libvirt with virt-network support": "",
"Reinstall VirtualBox and verify that it is not blocked: System Preferences -\u003e Security \u0026 Privacy -\u003e General -\u003e Some system software was blocked from loading": "",
"Related issues:": "",
"Relaunching Kubernetes %s using %s ... ": "",
"Requested disk size (%dMB) is less than minimum of %dMB": "",
"Requested disk size (%dMB) is less than minimum of (%dMB)": "",
"Requested memory allocation (%dMB) is less than the default memory allocation of (%dMB). Beware that Minikube might not work correctly or crash unexpectedly.": "",
"Requested memory allocation (%dMB) is less than the minimum allowed of %dMB": "",
"Restarting existing %s VM for %q ...": "",
"Run 'minikube delete' to delete the stale VM": "",
"Run 'minikube delete'. If the problem persists, check your proxy or firewall configuration": "",
"Run 'sudo modprobe vboxdrv' and reinstall VirtualBox if it fails.": "",
"Run minikube from the C: drive.": "",
"Set failed": "",
"Setting profile failed": "",
"Skipped switching kubectl context for %s , because --keep-context": "",
"Sorry that minikube crashed. If this was unexpected, we would love to hear from you:": "",
"Sorry, completion support is not yet implemented for %q": "",
"Sorry, the --gpu feature is currently only supported with --vm-driver=kvm2": "",
"Sorry, the --hidden feature is currently only supported with --vm-driver=kvm2": "",
"Sorry, the kubeadm.%s parameter is currently not supported by --extra-config": "",
"Sorry, url provided with --registry-mirror flag is invalid %q": "",
"Specify --kubernetes-version in v\u003cmajor\u003e.\u003cminor.\u003cbuild\u003e form. example: 'v1.1.14'": "",
"Specify an alternate --host-only-cidr value, such as 172.16.0.1/24": "",
"Stopping %q in %s ...": "",
"Successfully mounted %s to %s": "",
"Target directory %q must be an absolute path": "",
"The %q cluster has been deleted.": "",
"The 'docker-machine-driver-kvm2' version is old. Please consider upgrading. %s": "",
"The 'none' driver provides limited isolation and may reduce system security and reliability.": "",
"The KVM driver is unable to resurrect this old VM. Please run `minikube delete` to delete it and try again.": "",
"The VM driver exited with an error, and may be corrupt. Run 'minikube start' with --alsologtostderr -v=8 to see the error": "",
"The docker host is currently not running": "",
"The docker service is currently not active": "",
"The kvm driver is deprecated and support for it will be removed in a future release.\n\t\t\t\tPlease consider switching to the kvm2 driver, which is intended to replace the kvm driver.\n\t\t\t\tSee https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver for more information.\n\t\t\t\tTo disable this message, run [minikube config set ShowDriverDeprecationNotification false]": "",
"The minikube VM is offline. Please run 'minikube start' to start it again.": "",
"The value passed to --format is invalid": "",
"The value passed to --format is invalid: %s": "",
"The vmwarefusion driver is deprecated and support for it will be removed in a future release.\n\t\t\t\tPlease consider switching to the new vmware unified driver, which is intended to replace the vmwarefusion driver.\n\t\t\t\tSee https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#vmware-unified-driver for more information.\n\t\t\t\tTo disable this message, run [minikube config set ShowDriverDeprecationNotification false]": "",
@ -177,9 +216,11 @@
"Uninstalling Kubernetes %s using %s ...": "",
"Unmounting %s ...": "",
"Update server returned an empty list": "",
"Upgrade to QEMU v3.1.0+, run 'virt-host-validate', or ensure that you are not running in a nested VM environment.": "",
"Usage: minikube completion SHELL": "",
"Userspace file server is shutdown": "",
"Userspace file server: ": "",
"Verify that your HTTP_PROXY and HTTPS_PROXY environment variables are set correctly.": "",
"Verifying dashboard health ...": "",
"Verifying proxy health ...": "",
"Verifying:": "正在验证:",
@ -189,6 +230,8 @@
"Waiting for SSH access ...": "",
"You appear to be using a proxy, but your NO_PROXY environment does not include the minikube IP (%s). Please see https://github.com/kubernetes/minikube/blob/master/docs/http_proxy.md for more details": "",
"You must specify a service name": "",
"Your host does not support KVM virtualization. Ensure that qemu-kvm is installed, and run 'virt-host-validate' to debug the problem": "",
"Your host is failing to route packets to the minikube VM. If you have VPN software, try turning it off or configuring it so that it does not re-route traffic to the VM IP. If not, check your VM environment routing options.": "",
"addon '%s' is currently not enabled.\nTo enable this addon run:\nminikube addons enable %s": "",
"addon '%s' is not a valid addon packaged with minikube.\nTo see the list of available addons run:\nminikube addons list": "",
"addon list failed": "",
@ -211,12 +254,14 @@
"logdir set failed": "",
"minikube %s on %s (%s)": "您正在使用minikube %s 运行平台:%s (%s)",
"minikube is not running, so the service cannot be accessed": "",
"minikube is unable to access the Google Container Registry. You may need to configure it to use a HTTP proxy.": "",
"minikube profile was successfully set to %s": "",
"minikube will upgrade the local cluster from Kubernetes %s to %s": "",
"mount argument %q must be in form: \u003csource directory\u003e:\u003ctarget directory\u003e": "",
"mount failed": "",
"need to relocate them. For example, to overwrite your own settings:": "",
"opt %s": "",
"service %s/%s has no node port": "",
"stat failed": "",
"unable to bind flags": "",
"unable to set logtostderr": "",