Fix priority mode names not being translated
This commit is contained in:
1 parent
1b17dd6784
commit
9329e52643
1 file changed
+13
-6
@@ -1536,11 +1536,18 @@ class _SettingsVars(TypedDict):
|
|||||||
class SettingsPanel:
|
class SettingsPanel:
|
||||||
AUTOSTART_NAME: str = "TwitchDropsMiner"
|
AUTOSTART_NAME: str = "TwitchDropsMiner"
|
||||||
AUTOSTART_KEY: str = "HKCU/Software/Microsoft/Windows/CurrentVersion/Run"
|
AUTOSTART_KEY: str = "HKCU/Software/Microsoft/Windows/CurrentVersion/Run"
|
||||||
PRIORITY_MODES: dict[PriorityMode, str] = {
|
|
||||||
PriorityMode.PRIORITY_ONLY: _("gui", "settings", "priority_modes", "priority_only"),
|
@cached_property
|
||||||
PriorityMode.ENDING_SOONEST: _("gui", "settings", "priority_modes", "ending_soonest"),
|
def PRIORITY_MODES(self) -> dict[PriorityMode, str]:
|
||||||
PriorityMode.LOW_AVBL_FIRST: _("gui", "settings", "priority_modes", "low_availability"),
|
# NOTE: Translation calls have to be deferred here,
|
||||||
}
|
# to allow changing the language before the settings panel is initialized.
|
||||||
|
return {
|
||||||
|
PriorityMode.PRIORITY_ONLY: _("gui", "settings", "priority_modes", "priority_only"),
|
||||||
|
PriorityMode.ENDING_SOONEST: _("gui", "settings", "priority_modes", "ending_soonest"),
|
||||||
|
PriorityMode.LOW_AVBL_FIRST: _(
|
||||||
|
"gui", "settings", "priority_modes", "low_availability"
|
||||||
|
),
|
||||||
|
}
|
||||||
|
|
||||||
def __init__(self, manager: GUIManager, master: ttk.Widget):
|
def __init__(self, manager: GUIManager, master: ttk.Widget):
|
||||||
self._twitch = manager._twitch
|
self._twitch = manager._twitch
|
||||||
@@ -2408,7 +2415,7 @@ if __name__ == "__main__":
|
|||||||
mock.change_state = lambda state: mock.gui.print(f"State change: {state.value}")
|
mock.change_state = lambda state: mock.gui.print(f"State change: {state.value}")
|
||||||
mock.state_change = lambda state: partial(mock.change_state, state)
|
mock.state_change = lambda state: partial(mock.change_state, state)
|
||||||
mock.request = aiohttp.request
|
mock.request = aiohttp.request
|
||||||
# _.set_language("Dansk")
|
# _.set_language("Русский")
|
||||||
gui = GUIManager(mock) # type: ignore
|
gui = GUIManager(mock) # type: ignore
|
||||||
mock.gui = gui
|
mock.gui = gui
|
||||||
mock.close = gui.stop
|
mock.close = gui.stop
|
||||||
|
|||||||
Reference in new issue
Block a user