def names(self) -> EnumValues: """Return a mapping from property values to their labels in the current locale.""" locale = get_locale() if locale not in self._names: self._names[locale] = self._locale_names(locale) return self._names[locale]
def names(self): locale = get_locale() if locale not in self._names: self._names[locale] = {} for code, label in locale.languages.items(): self._names[locale][code.lower()] = label return self._names[locale]
def names(self): locale = get_locale() if locale not in self._names: # extra territories that OCCRP is interested in. self._names[locale] = { 'zz': gettext('Global'), 'eu': gettext('European Union'), # Overwrite "Czechia" label: 'cz': gettext('Czech Republic'), 'xk': gettext('Kosovo'), 'yucs': gettext('Yugoslavia'), 'csxx': gettext('Serbia and Montenegro'), 'suhh': gettext('Soviet Union'), 'ge-ab': gettext('Abkhazia'), 'x-so': gettext('South Ossetia'), 'so-som': gettext('Somaliland'), 'gb-wls': gettext('Wales'), 'gb-sct': gettext('Scotland'), 'md-pmr': gettext('Transnistria') } for code, label in locale.territories.items(): try: int(code) except ValueError: self._names[locale][code.lower()] = label return self._names[locale]
def names(self): locale = get_locale() if locale not in self._names: self._names[locale] = {} for lang in self.LANGUAGES: self._names[locale][lang] = lang for code, label in locale.languages.items(): code = iso_639_alpha3(code) if code in self.LANGUAGES: self._names[locale][code] = label return self._names[locale]
def names(self): locale = get_locale() if locale not in self._names: self._names[locale] = self._locale_names(locale) return self._names[locale]