betty.locale.localizable.config module

Provide localizable configuration.

final class betty.locale.localizable.config.StaticTranslationsLocalizableConfiguration[source]

Bases: Configuration, Localizable

Provide configuration for a betty.locale.Localizable.

Read more at multiple translations.

__init__(translations: Mapping[str, str] | str | None = None, *, minimum: int = 1)[source]
Parameters:

translations – Keys are locales, values are translations.

dump() bool | int | float | str | None | MutableSequence[bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]] | MutableMapping[str, bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]] | type[Void][source]

Dump this instance to a portable format.

load(dump: bool | int | float | str | None | MutableSequence[bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]] | MutableMapping[str, bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]]) None[source]

Load dumped configuration.

Raises:

betty.assertion.error.AssertionFailed – Raised if the dump contains invalid configuration.

localize(localizer: Localizer) str[source]

Localize self to a human-readable string.

set(translations: Mapping[str, str] | str) None[source]

Set the translations.

update(other: Self) None[source]

Update this configuration with the values from other.

final class betty.locale.localizable.config.StaticTranslationsLocalizableConfigurationProperty[source]

Bases: object

A property (similar to property()) that contains betty.locale.localizable.StaticTranslationsLocalizableConfiguration.

__init__(attr_name: str, *, minimum: int = 1)[source]