gh-87281: Improve documentation for locale.setlocale() and locale.getlocale()#137313
gh-87281: Improve documentation for locale.setlocale() and locale.getlocale()#137313serhiy-storchaka merged 6 commits intopython:mainfrom
Conversation
|
Reference to RFC 1766 was incorrect -- RFC 1766 specifies language and territory separated by a minus instead of underscore, and it does not contain much useful information anyway. Also,
Added specification of universally accepted formats. Late |
Doc/library/locale.rst
Outdated
|
|
||
| The format of the *locale* and the language code strings is platform | ||
| depended, but the forms ``language[_territory][.encoding][@modifier]`` | ||
| and ``language[_territory]`` respectively are typically accepted on all |
There was a problem hiding this comment.
| and ``language[_territory]`` respectively are typically accepted on all | |
| and ``language[_territory]`` are typically accepted on all |
I'm not sure what this is referring to?
There was a problem hiding this comment.
It refers to the locale and the language code strings.
There was a problem hiding this comment.
If this is not clear, we can only specify format for locale, and then say that the language code has the same format, but without encoding and modifier (support for modifiers will be added in #137253).
There was a problem hiding this comment.
I'd write: "the form language[_territory][.encoding][@modifier] is typically accepted".
The second version you mention is already included in this.
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Thank you for your grammar fixes @StanFromIreland.
Doc/library/locale.rst
Outdated
|
|
||
| The format of the *locale* and the language code strings is platform | ||
| depended, but the forms ``language[_territory][.encoding][@modifier]`` | ||
| and ``language[_territory]`` respectively are typically accepted on all |
There was a problem hiding this comment.
It refers to the locale and the language code strings.
malemburg
left a comment
There was a problem hiding this comment.
LGTM modulo the small change requests.
Doc/library/locale.rst
Outdated
|
|
||
| The format of the *locale* and the language code strings is platform | ||
| depended, but the forms ``language[_territory][.encoding][@modifier]`` | ||
| and ``language[_territory]`` respectively are typically accepted on all |
There was a problem hiding this comment.
I'd write: "the form language[_territory][.encoding][@modifier] is typically accepted".
The second version you mention is already included in this.
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
|
I am going to merge this PR tomorrow if there are no new comments. |
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…le.getlocale() (pythonGH-137313) Add a section explaining the locale name formats. (cherry picked from commit 15ab457) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…le.getlocale() (pythonGH-137313) Add a section explaining the locale name formats. (cherry picked from commit 15ab457) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
GH-137722 is a backport of this pull request to the 3.14 branch. |
|
GH-137723 is a backport of this pull request to the 3.13 branch. |
…le.getlocale() (pythonGH-137313) Add a section explaining the locale name formats.
📚 Documentation preview 📚: https://cpython-previews--137313.org.readthedocs.build/