-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
bpo-39464: Allow translating argument error messages #17169
Conversation
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). Recognized GitHub usernameWe couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames: This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
Thanks for your time @DjMorgul, and welcome to CPython! 😎 I assume that you've seen the bot's message about the CLA? |
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 don't think this is necessary... we don't internationalize any other exception messages in this file.
If this exception is raised during parsing, it is printed by calling ArgumentParser.error
, which performs this step already (see the last line of the file).
It would be great if you could open a BPO issue for discussion.
This message isn't used (only?) in exceptions... it's a message that is given to the console, to notify the user when she didn't provide correct parameters. For example:
These are console messages localized into Spanish. The "error:" part is translatable, but it's the same word in Spanish than in English. The "argument" part is what isn't translatable, and it's taken from this "exception". I confirmed that my proposed patch, translating that particular string, allows giving a fully localized console output to the user in Spanish, such as:
|
@DjMorgul, the place to discuss this is on our issue tracker. Please create an issue on bugs.python.org, as suggested above by @brandtbucher. |
I just created the issue on bugs.python.org, and I updated the title of this pull request accordingly. |
Argument error messages display the untranslatable text 'argument ', which should be translatable to other languages, just like it's possible to do with the rest of the constructed error message.
https://bugs.python.org/issue39464