betty.gui.locale module - Betty 0.4.0a1 documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.gui.locale module

Provide locale management for the Graphical User Interface.

class betty.gui.locale.LocalizedObject

  Bases: `object`

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

  Parameters:

    - app (`betty.app.App`)

    - args (`typing.Any`)

    - kwargs (`typing.Any`)

  __init__(app: betty.app.App, *args: Any, **kwargs: Any)
    Parameters:

      - app (`betty.app.App`)

      - args (`typing.Any`)

      - kwargs (`typing.Any`)

  showEvent(a0: QtGui.QShowEvent | None) → None
    Parameters:

      - self (LocalizedObject & QWidget)

      - a0 (QtGui.QShowEvent | None)

    Return type:

      None

class betty.gui.locale.TranslationsLocaleCollector

  Bases: `LocalizedObject`

  Helps users select a locale for which translations are available.

  Parameters:

    - app (`betty.app.App`)

    - allowed_locales (`set`[`str`])

  __init__(app: betty.app.App, allowed_locales: set[str])
    Parameters:

      - app (`betty.app.App`)

      - allowed_locales (`set`[`str`])

  property locale: QComboBox

    The selected locale.

  property rows: list[list[QWidget]]

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