gh-64243: Implement locale.getlocale fall back in gettext.find#131477
gh-64243: Implement locale.getlocale fall back in gettext.find#131477StanFromIreland wants to merge 12 commits intopython:mainfrom
locale.getlocale fall back in gettext.find#131477Conversation
|
request: @tomasr8 |
|
@serhiy-storchaka Could you please review this? |
serhiy-storchaka
left a comment
There was a problem hiding this comment.
There are issues with using locale.getlocale(). It ignores the modifier and can raise ValueError. I suggest to use locale._setlocale().
Needed tests for locales "C", "C.UTF-8", locales with a modifier, locales with and without encoding.
To help testing, you can extract the code into the _guess_languages() function.
|
There are several existing tests (from a previous pr) for the C locale. |
|
CIs don’t have some locale, I will have to add requirements. |
|
@tomasr8 as the expert now, could I get a review:-) |
|
I can have a look this weekend, though I'd still prefer to get a final signoff from Serhiy :) |
|
This PR is stale because it has been open for 30 days with no activity. |
LANGUAGES envvar is prioritized over getlocale for consistency with C gettext.
📚 Documentation preview 📚: https://cpython-previews--131477.org.readthedocs.build/