GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — bpo-18319: gettext() can retrieve a message even if a plural form exists by gbassiere · Pull Request #19869 · python/cpython 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! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| return message | ||
| try: | ||
| # if `message` has plural forms | ||
| tmsg = self._catalog[(message, self.plural(1))] |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| tmsg = self._catalog[(message, self.plural(1))] | |
| return self._catalog[(message, self.plural(1))] |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if self._fallback: | ||
| return self._fallback.gettext(message) | ||
| return message | ||
| try: |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I suggest simply adding the following before the existing if tmsg is missing: ... block:
if tmsg is missing: tmsg = self._catalog.get((message, self.plural(1)), missing)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Just noticed this annoying bug as well (via babel). It's impossible to work around without starting to mess around with message contexts (and I should NOT need to add garbage to my code (and pot files) because of this), so it would be great if this fix could get merged.. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Should this logic be also added to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @gbassiere for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @gbassiere for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-107107 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-107108 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…sts (pythonGH-19869) (cherry picked from commit 5463252) Co-authored-by: Gilles Bassière <[email protected]>
…sts (pythonGH-19869) (cherry picked from commit 5463252) Co-authored-by: Gilles Bassière <[email protected]>
…orm exists (GH-19869) (#107108) (cherry picked from commit 5463252) Co-authored-by: Gilles Bassière <[email protected]>
…orm exists (GH-19869) (GH-107107) (cherry picked from commit 5463252) Co-authored-by: Gilles Bassière <[email protected]>
After python/cpython#19869 PR merged gettext() can lookup plural() which is not set when constructor argument (file handler) is unspecified
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.