@@ -46,16 +46,6 @@ class-based API instead.
46
46
returned. [# ]_
47
47
48
48
49
- .. function :: bind_textdomain_codeset(domain, codeset=None)
50
-
51
- Bind the *domain * to *codeset *, changing the encoding of byte strings
52
- returned by the :func: `lgettext `, :func: `ldgettext `, :func: `lngettext `
53
- and :func: `ldngettext ` functions.
54
- If *codeset * is omitted, then the current binding is returned.
55
-
56
- .. deprecated-removed :: 3.8 3.10
57
-
58
-
59
49
.. function :: textdomain(domain=None)
60
50
61
51
Change or query the current global domain. If *domain * is ``None ``, then the
@@ -108,29 +98,6 @@ class-based API instead.
108
98
.. versionadded :: 3.8
109
99
110
100
111
- .. function :: lgettext(message)
112
- .. function :: ldgettext(domain, message)
113
- .. function :: lngettext(singular, plural, n)
114
- .. function :: ldngettext(domain, singular, plural, n)
115
-
116
- Equivalent to the corresponding functions without the ``l `` prefix
117
- (:func: `.gettext `, :func: `dgettext `, :func: `ngettext ` and :func: `dngettext `),
118
- but the translation is returned as a byte string encoded in the preferred
119
- system encoding if no other encoding was explicitly set with
120
- :func: `bind_textdomain_codeset `.
121
-
122
- .. warning ::
123
-
124
- These functions should be avoided in Python 3, because they return
125
- encoded bytes. It's much better to use alternatives which return
126
- Unicode strings instead, since most Python applications will want to
127
- manipulate human readable text as strings instead of bytes. Further,
128
- it's possible that you may get unexpected Unicode-related exceptions
129
- if there are encoding problems with the translated strings.
130
-
131
- .. deprecated-removed :: 3.8 3.10
132
-
133
-
134
101
Note that GNU :program: `gettext ` also defines a :func: `dcgettext ` method, but
135
102
this was deemed not useful and so it is currently unimplemented.
136
103
@@ -181,7 +148,7 @@ install themselves in the built-in namespace as the function :func:`_`.
181
148
the environment variables.
182
149
183
150
184
- .. function :: translation(domain, localedir=None, languages=None, class_=None, fallback=False, codeset=None )
151
+ .. function :: translation(domain, localedir=None, languages=None, class_=None, fallback=False)
185
152
186
153
Return a :class: `*Translations ` instance based on the *domain *, *localedir *,
187
154
and *languages *, which are first passed to :func: `find ` to get a list of the
@@ -205,15 +172,13 @@ install themselves in the built-in namespace as the function :func:`_`.
205
172
.. versionchanged :: 3.3
206
173
:exc: `IOError ` used to be raised instead of :exc: `OSError `.
207
174
208
- .. deprecated-removed :: 3.8 3.10
209
- The *codeset * parameter.
210
-
175
+ .. versionchanged :: 3.11
176
+ *codeset * parameter is removed.
211
177
212
- .. function :: install(domain, localedir=None, codeset=None , names=None)
178
+ .. function :: install(domain, localedir=None, * , names=None)
213
179
214
180
This installs the function :func: `_ ` in Python's builtins namespace, based on
215
- *domain *, *localedir *, and *codeset * which are passed to the function
216
- :func: `translation `.
181
+ *domain * and *localedir * which are passed to the function :func: `translation `.
217
182
218
183
For the *names * parameter, please see the description of the translation
219
184
object's :meth: `~NullTranslations.install ` method.
@@ -228,9 +193,8 @@ install themselves in the built-in namespace as the function :func:`_`.
228
193
builtins namespace, so it is easily accessible in all modules of your
229
194
application.
230
195
231
- .. deprecated-removed :: 3.8 3.10
232
- The *codeset * parameter.
233
-
196
+ .. versionchanged :: 3.11
197
+ *names * is now a keyword-only parameter.
234
198
235
199
The :class: `NullTranslations ` class
236
200
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -294,22 +258,6 @@ are the methods of :class:`!NullTranslations`:
294
258
.. versionadded :: 3.8
295
259
296
260
297
- .. method :: lgettext(message)
298
- .. method :: lngettext(singular, plural, n)
299
-
300
- Equivalent to :meth: `.gettext ` and :meth: `.ngettext `, but the translation
301
- is returned as a byte string encoded in the preferred system encoding
302
- if no encoding was explicitly set with :meth: `set_output_charset `.
303
- Overridden in derived classes.
304
-
305
- .. warning ::
306
-
307
- These methods should be avoided in Python 3. See the warning for the
308
- :func: `lgettext ` function.
309
-
310
- .. deprecated-removed :: 3.8 3.10
311
-
312
-
313
261
.. method :: info()
314
262
315
263
Return the "protected" :attr: `_info ` variable, a dictionary containing
@@ -321,21 +269,6 @@ are the methods of :class:`!NullTranslations`:
321
269
Return the encoding of the message catalog file.
322
270
323
271
324
- .. method :: output_charset()
325
-
326
- Return the encoding used to return translated messages in :meth: `.lgettext `
327
- and :meth: `.lngettext `.
328
-
329
- .. deprecated-removed :: 3.8 3.10
330
-
331
-
332
- .. method :: set_output_charset(charset)
333
-
334
- Change the encoding used to return translated messages.
335
-
336
- .. deprecated-removed :: 3.8 3.10
337
-
338
-
339
272
.. method :: install(names=None)
340
273
341
274
This method installs :meth: `.gettext ` into the built-in namespace,
@@ -450,22 +383,6 @@ unexpected, or if other problems occur while reading the file, instantiating a
450
383
.. versionadded :: 3.8
451
384
452
385
453
- .. method :: lgettext(message)
454
- .. method :: lngettext(singular, plural, n)
455
-
456
- Equivalent to :meth: `.gettext ` and :meth: `.ngettext `, but the translation
457
- is returned as a byte string encoded in the preferred system encoding
458
- if no encoding was explicitly set with
459
- :meth: `~NullTranslations.set_output_charset `.
460
-
461
- .. warning ::
462
-
463
- These methods should be avoided in Python 3. See the warning for the
464
- :func: `lgettext ` function.
465
-
466
- .. deprecated-removed :: 3.8 3.10
467
-
468
-
469
386
Solaris message catalog support
470
387
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
471
388
0 commit comments