2 # Author: David Goodger <goodger@python.org>
3 # Copyright: This module has been placed in the public domain.
5 # Internationalization details are documented in
6 # <http://docutils.sf.net/docs/howto/i18n.html>.
9 This package contains modules for language-dependent features of
13 __docformat__
= 'reStructuredText'
17 from docutils
.utils
import normalize_language_tag
18 if sys
.version_info
< (2,5):
19 from docutils
._compat
import __import__
23 def get_language(language_code
):
24 for tag
in normalize_language_tag(language_code
):
25 tag
= tag
.replace('-','_') # '-' not valid in module names
27 return _languages
[tag
]
29 module
= __import__(tag
, globals(), locals(), level
=0)
32 module
= __import__(tag
, globals(), locals(), level
=1)
35 _languages
[tag
] = module