parameters: (language_code, reporter=None)
return_statement: return module
docstring: Return module with language localizations.
  
      `language_code` is a "BCP 47" language tag.
      If there is no matching module, warn and fall back to English.
docstring_summary: Return module with language localizations.
docstring_tokens: Return module with language localizations .
function: def get_language(language_code, reporter=None):
      """Return module with language localizations.
  
      `language_code` is a "BCP 47" language tag.
      If there is no matching module, warn and fall back to English.
      """
      # TODO: use a dummy module returning emtpy strings?, configurable?
      for tag in normalize_language_tag(language_code):
          tag = tag.replace('-','_') # '-' not valid in module names
          if tag in _languages:
              return _languages[tag]
          try:
              module = __import__(tag, globals(), locals(), level=1)
          except ImportError:
              try:
                  module = __import__(tag, globals(), locals(), level=0)
              except ImportError:
                  continue
          _languages[tag] = module
          return module
      if reporter is not None:
          reporter.warning(
              'language "%s" not supported: ' % language_code +
              'Docutils-generated text will be in English.')
      module = __import__('en', globals(), locals(), level=1)
      _languages[tag] = module # warn only one time!
      return module
function_tokens: def get_language ( language_code , reporter = None ) : # TODO: use a dummy module returning emtpy strings?, configurable? for tag in normalize_language_tag ( language_code ) : tag = tag . replace ( '-' , '_' ) # '-' not valid in module names if tag in _languages : return _languages [ tag ] try : module = __import__ ( tag , globals ( ) , locals ( ) , level = 1 ) except ImportError : try : module = __import__ ( tag , globals ( ) , locals ( ) , level = 0 ) except ImportError : continue _languages [ tag ] = module return module if reporter is not None : reporter . warning ( 'language "%s" not supported: ' % language_code + 'Docutils-generated text will be in English.' ) module = __import__ ( 'en' , globals ( ) , locals ( ) , level = 1 ) _languages [ tag ] = module # warn only one time! return module