-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
gh-87281: Improve documentation for locale.setlocale() and locale.getlocale() #137313
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
Changes from 1 commit
60a26f7
b78ca1b
10228bc
53d7bcb
1a16363
d3aa0bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -34,12 +34,18 @@ The :mod:`locale` module defines the following exception and functions: | |||||
|
||||||
If *locale* is given and not ``None``, :func:`setlocale` modifies the locale | ||||||
setting for the *category*. The available categories are listed in the data | ||||||
description below. *locale* may be a string, or an iterable of two strings | ||||||
(language code and encoding). If it's an iterable, it's converted to a locale | ||||||
description below. *locale* may be a string, or a pair, | ||||||
language code and encoding. If it is a pair, it is converted to a locale | ||||||
name using the locale aliasing engine. An empty string specifies the user's | ||||||
default settings. If the modification of the locale fails, the exception | ||||||
:exc:`Error` is raised. If successful, the new locale setting is returned. | ||||||
|
||||||
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 | ||||||
|
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It refers to the locale and the language code strings.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd write: "the form language[_territory][.encoding][@modifier]
is typically accepted".
The second version you mention is already included in this.
Uh oh!
There was an error while loading. Please reload this page.