pysepal.sepalwidgets.vue_app.LocaleSelect#

class pysepal.sepalwidgets.vue_app.LocaleSelect(*args, **kwargs)[source]#

Instantiate the LocaleSelect class.

The effective locale is resolved in the browser (localStorage -> navigator.language -> “en”) and pushed back through selected_locale; this class only mirrors the resolved value into the bound LocaleState.

Parameters:
  • translator (Translator | None) – Translator whose catalogs become the offered languages.

  • locales (Iterable[str] | None) – Offered locale codes, taking precedence over translator.

  • locale_state (LocaleState | None) – Shared state to mirror the resolved locale into.

  • kwargs – any argument for a VuetifyTemplate object.

Attributes

COUNTRIES

available_locales

An instance of a Python list.

selected_locale

A trait for unicode strings.

template_file

A trait for unicode strings.

value

A trait for unicode strings.

Methods

__init__

Instantiate the LocaleSelect class.

bind_locale_state

Bind the widget to a shared locale state.

get_locale_state

Return the currently bound locale state.

LocaleSelect.__init__(translator=None, locales=None, locale_state=None, **kwargs)[source]#

Instantiate the LocaleSelect class.

The effective locale is resolved in the browser (localStorage -> navigator.language -> “en”) and pushed back through selected_locale; this class only mirrors the resolved value into the bound LocaleState.

Parameters:
  • translator (Translator | None) – Translator whose catalogs become the offered languages.

  • locales (Iterable[str] | None) – Offered locale codes, taking precedence over translator.

  • locale_state (LocaleState | None) – Shared state to mirror the resolved locale into.

  • kwargs – any argument for a VuetifyTemplate object.

LocaleSelect.bind_locale_state(locale_state)[source]#

Bind the widget to a shared locale state.

Parameters:

locale_state (LocaleState | None)

Return type:

None

LocaleSelect.get_locale_state()[source]#

Return the currently bound locale state.

Return type:

LocaleState | None