wikidata.multilingual — Multilingual texts¶
-
class
wikidata.multilingual.MonolingualText¶ Locale-denoted text. It’s almost equivalent to
str(and indeed subclassesstr) except that it has two more attribute:localeandlocale_codethat denote what language the text is written in.
-
wikidata.multilingual.normalize_locale_code(locale: typing.Union[babel.core.Locale, str]) → str¶ Determine the normalized locale code string.
>>> normalize_locale_code('ko-kr') 'ko_KR' >>> normalize_locale_code('zh_TW') 'zh_Hant_TW' >>> normalize_locale_code(Locale.parse('en_US')) 'en_US'