-
-
Notifications
You must be signed in to change notification settings - Fork 30.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
argparse: the word 'default' (in help) is not marked as translatable #77956
Comments
The word 'default', used to indicate default arguments in the help text (found here: Lib/argparse.py:681) is missing the gettext wrapper, causing it to be untranslatable. |
Note: the line number in the link is not correct anymore, I'm not sure how to link to a specific commit so here is the source line: |
@paul.j3 I assume this is an easy issue of wrapping "default" with _() at [0]. There doesn't seem to be any tests for localization in argparse. Line 682 in 2ea8099
|
I haven't paid much attention to the localization issues in The issue is with the help modification done by the: class ArgumentDefaultsHelpFormatter
This formatter is a convenience, not something critical. The programmer could always include that 'default' string in the help line with their preferred terminology. They don't have to use this formatter to show the default values in their help lines. _() is used mostly for error messages with the format msg = _('message %(value)s')
raise Error( msg % args) So the following change might work:
But I'm not in a position to test it or evaluate its usefulness. |
https://bugs.python.org/issue16786 points out that the 'version' action isn't localizable either. |
…GH-12711) Co-authored-by: paul.j3 Co-authored-by: Jérémie Detrey <jdetrey@users.noreply.github.com>
…t localizable (pythonGH-12711) (cherry picked from commit da382aa) Co-authored-by: Emmanuel Arias <eamanu@yaerobi.com> Co-authored-by: paul.j3 Co-authored-by: Jérémie Detrey <jdetrey@users.noreply.github.com>
…t localizable (pythonGH-12711) (cherry picked from commit da382aa) Co-authored-by: Emmanuel Arias <eamanu@yaerobi.com> Co-authored-by: paul.j3 Co-authored-by: Jérémie Detrey <jdetrey@users.noreply.github.com>
…izable (pythonGH-12711) Co-authored-by: paul.j3 Co-authored-by: Jérémie Detrey <jdetrey@users.noreply.github.com>
…izable (pythonGH-12711) Co-authored-by: paul.j3 Co-authored-by: Jérémie Detrey <jdetrey@users.noreply.github.com>
…izable (pythonGH-12711) Co-authored-by: paul.j3 Co-authored-by: Jérémie Detrey <jdetrey@users.noreply.github.com>
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: