wikidata.multilingual — Multilingual texts#

class wikidata.multilingual.Locale#

The locale of each MonolingualText or internal mapping of each MultilingualText. Alias of str.

New in version 0.7.0.

alias of str

class wikidata.multilingual.MonolingualText(text: str, locale: Locale)#

Locale-denoted text. It’s almost equivalent to str (and indeed subclasses str) except that it has an extra attribute, locale, that denotes what language the text is written in.

Changed in version 0.8.0: The type hint of the constructor’s locale parameter became Locale.

locale: Locale#

(Locale) The code of locale.

Changed in version 0.7.0: The type became Locale (was babel.core.Locale).

class wikidata.multilingual.MultilingualText(texts: Mapping[Locale | str, str])#