betty.locale package¶
Subpackages¶
- betty.locale.localizable package
- Submodules
- Module contents
Submodules¶
Module contents¶
Provide the Locale API.
- betty.locale.get_data(locale: str | Locale) Locale [source]¶
Get locale metadata.
- Raises:
betty.locale.InvalidLocale – Raised if the given identifier is not a valid locale.
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.