Language¶
-
babelfish.language.
LANGUAGES
¶ Available language codes
-
babelfish.language.
LANGUAGE_MATRIX
¶ List of languages in the ISO-639-3 as namedtuple of alpha3, alpha3b, alpha3t, alpha2, scope, type, name and comment
-
class
babelfish.language.
LanguageConverterManager
¶ ConverterManager
for language converters
-
babelfish.language.
LANGUAGE_CONVERTERS
¶ Instance of
LanguageConverterManager
-
class
babelfish.language.
LanguageMeta
¶ The
Language
metaclassDynamically redirect
Language.frommycode()
toLanguage.fromcode()
with themycode
converter
-
class
babelfish.language.
Language
(language, country=None, script=None, unknown=None)¶ A human language
A human language is composed of a language part following the ISO-639 standard and can be country-specific when a
Country
is specified.The
Language
is extensible with custom converters (see Custom Converters)Parameters: - language (string) – the language as a 3-letter ISO-639-3 code
- country (string or
Country
or None) – the country (if any) as a 2-letter ISO-3166 code orCountry
instance - script (string or
Script
or None) – the script (if any) as a 4-letter ISO-15924 code orScript
instance - unknown (string or None) – the unknown language as a three-letters ISO-639-3 code to use as fallback
Raise: ValueError if the language could not be recognized and unknown is
None
-
classmethod
fromcode
(code, converter)¶ Create a
Language
by its code using converter toreverse()
itParameters: - code (string) – the code to reverse
- converter (string) – name of the
LanguageReverseConverter
to use
Returns: the corresponding
Language
instanceReturn type: