betty.gui.locale module

Provide locale management for the Graphical User Interface.

class betty.gui.locale.LocalizedObject[source]

Bases: object

A PyQt6.QtWidgets.QWidget mix-in to localize widgets, and re-localize them when the locale changes.

Parameters:
__init__(app: betty.app.App, *args: Any, **kwargs: Any)[source]
Parameters:
showEvent(a0: QtGui.QShowEvent | None) None[source]
Parameters:
  • self (LocalizedObject & QWidget)

  • a0 (QtGui.QShowEvent | None)

Return type:

None

class betty.gui.locale.TranslationsLocaleCollector[source]

Bases: LocalizedObject

Helps users select a locale for which translations are available.

Parameters:
__init__(app: betty.app.App, allowed_locales: set[str])[source]
Parameters:
property locale: QComboBox

The selected locale.

property rows: list[list[QWidget]]

The PyQt6.QtWidgets.QFormLayout rows provided by the collector.