betty.locale package¶
Submodules¶
Module contents¶
Provide the Locale API.
- exception betty.locale.LocaleNotFoundError[source]¶
Bases:
RuntimeErrorRaise when a locale could not be found.
- betty.locale.get_data(locale: str | Locale) Locale[source]¶
Get locale metadata.
- Raises:
betty.locale.LocaleNotFoundError – Raised if the given locale cannot be found.
- betty.locale.get_display_name(locale: str | Locale, display_locale: str | Locale | None = None) str | None[source]¶
Return a locale’s human-readable display name.
- betty.locale.negotiate_locale(preferred_locales: str | Locale | Sequence[str | Locale], available_locales: Sequence[str | Locale]) Locale | None[source]¶
Negotiate the preferred locale from a sequence.