1
Description: Restore historical behavior of languages.get_language() taking only a single argument.
2
In Docutils 0.8, a second argument was added to languages.get_language(). This
3
patch makes the function accept also only a single argument in order to
4
restore its historical behavior.
5
Author: Jakub Wilk <jwilk@debian.org>
6
Bug: http://sourceforge.net/tracker/?group_id=38414&atid=422030
7
Bug-Debian: http://bugs.debian.org/641562
8
Last-Update: 2011-09-16
10
--- a/docutils/languages/__init__.py
11
+++ b/docutils/languages/__init__.py
16
-def get_language(language_code, reporter):
17
+def get_language(language_code, reporter=None):
18
"""Return module with language localizations.
20
`language_code` is a "BCP 47" language tag.
23
_languages[tag] = module
26
- 'language "%s" not supported: ' % language_code +
27
- 'Docutils-generated text will be in English.')
28
+ if reporter is not None:
30
+ 'language "%s" not supported: ' % language_code +
31
+ 'Docutils-generated text will be in English.')
32
module = __import__('en', globals(), locals())
33
_languages[tag] = module # warn only one time!