Philipp Hahn
|
7c3edba6ce
|
python2/gettext improvements (#2235)
* py2: gettext: info()
returns a Dict[str, str]
<https://docs.python.org/2/library/gettext.html#gettext.NullTranslations.info>
> Return the “protected” _info variable.
<https://docs.python.org/2/library/gettext.html#the-gnutranslations-class>
> The entire set of key/value pairs are placed into a dictionary and set
> as the “protected” _info instance variable.
* py2: gettext: charset()
returns an Optional[str]
<https://docs.python.org/2/library/gettext.html#gettext.NullTranslations.charset>
> Return the “protected” _charset variable.
<https://docs.python.org/2/library/gettext.html#the-gnutranslations-class>
> If the key Content-Type is found, then the charset property is used to
> initialize the “protected” _charset instance variable, defaulting to
> None if not found.
* py2: gettext: [set_]output_charset()
allows to set an Optional[str]
<https://docs.python.org/2/library/gettext.html#gettext.NullTranslations.output_charset>
> Return the “protected” _output_charset variable.
<https://docs.python.org/2/library/gettext.html#gettext.NullTranslations.set_output_charset>
> Change the “protected” _output_charset variable, which defines the
> encoding used to return translated messages.
<https://docs.python.org/2/library/gettext.html#gettext.GNUTranslations.lgettext>
> Equivalent to gettext(), but the translation is returned in the
> preferred system encoding, if no other encoding was explicitly set with
> set_output_charset().
* py2: gettext: install(..., names)
allows to set an Optional[str]
<https://docs.python.org/2/library/gettext.html#gettext.NullTranslations.install>
> If the names parameter is given, it must be a sequence containing the
> names of functions you want to install in the builtins namespace in
> addition to _().
* py2: gettext: localdir=None
is Optional[str]
<https://docs.python.org/2/library/gettext.html#gettext.bindtextdomain>
> If localedir is omitted or None, then the current binding for domain
> is returned.
* py2: gettext: languages=None
is Optional[Sequence[str]]
<https://docs.python.org/2/library/gettext.html#gettext.find>
> If languages is not given, then the following environment variables
> are searched: ...
* py2: gettext: codeset=None
is Optional[str]
<https://docs.python.org/2/library/gettext.html#gettext.translation>
> If provided, codeset will change the charset used to encode translated
> strings.
* py2: gettext: translation(class_=None)
is Optional[type]
<https://docs.python.org/2/library/gettext.html#gettext.translation>
> The actual class instantiated is either class_ if provided, otherwise
> GNUTranslations.
* py2: gettext: translation(fallback)
is bool
<https://docs.python.org/2/library/gettext.html#gettext.translation>
> ..., this function raises IOError if fallback is false (which is the
> default), and returns a NullTranslations instance if fallback is true.
* py2: gettext: install(unicode)
is bool
<https://docs.python.org/2/library/gettext.html#gettext.install>
> The unicode flag is passed to the resulting translation object’s
> install() method.
which is already expecting `bool`.
|
2018-06-16 10:19:24 -07:00 |
|