-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to localize all strings output to console #4464
Add ability to localize all strings output to console #4464
Conversation
sharifelgamal
commented
Jun 10, 2019
•
edited
Loading
edited
- Adds code to translate strings based on system locale
- Adds string extraction code, in order to keep translations up to date
- Refactoring of some console code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks surprisingly complete and very close to mergeable. Thank you for your hard work!
"unable to set logtostderr": " ", | ||
"unsupported driver: %s": " ", | ||
"using image repository %s": " " | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a newline?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
json.Marshal spits the string out like this, not entirely sure how I'd want to add a newline there.
"Sorry that minikube crashed. If this was unexpected, we would love to hear from you:": " ", | ||
"Sorry, the --gpu feature is currently only supported with --vm-driver=kvm2": " ", | ||
"Sorry, the --hidden feature is currently only supported with --vm-driver=kvm2": " ", | ||
"Stopping %q in %s ...": " ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I now see why you were worried about context. I wonder if it's possible for us to provide a way so that callers can give translators more of a hint, such as:
Stopping %(name of service)s... in %(name of host)q ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is necessary and will be added in a future PR.
/approved |
/lgtm Just be sure to give the PR description a title that works well in the release notes. |
New changes are detected. LGTM label has been removed. |
This should now be ready for final review and merge. |
PrintToScreenNoInterface("http://kubernetes.io") | ||
|
||
// Test with something that Go thinks looks like a URL | ||
PrintToScreenNoInterface("Hint: This is not a URL, come on.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha love this
/lgtm /approve /ship-it! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sharifelgamal, tstromberg 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:
Approvers can indicate their approval by writing |