1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-06-26 09:52:34 +00:00

fix(tests): handle layout-specific translations

This commit is contained in:
obrusvit 2025-03-11 16:04:15 +01:00
parent e83f497652
commit 043de54bdf
2 changed files with 5 additions and 2 deletions

View File

@ -95,8 +95,6 @@ class LayoutType(Enum):
return cls.Eckhart return cls.Eckhart
if model in (models.T1B1,): if model in (models.T1B1,):
return cls.T1 return cls.T1
if model in (models.T3W1,):
return cls.Eckhart
raise ValueError(f"Unknown model: {model}") raise ValueError(f"Unknown model: {model}")
def __str__(self) -> str: def __str__(self) -> str:

View File

@ -75,6 +75,11 @@ def set_language(client: Client, lang: str, *, force: bool = False):
device.change_language(client, language_data) # type: ignore device.change_language(client, language_data) # type: ignore
_CURRENT_TRANSLATION.LAYOUT = client.layout_type _CURRENT_TRANSLATION.LAYOUT = client.layout_type
_CURRENT_TRANSLATION.TR = TRANSLATIONS[lang] _CURRENT_TRANSLATION.TR = TRANSLATIONS[lang]
_CURRENT_TRANSLATION.LAYOUT = client.layout_type
def set_layout(client: Client):
_CURRENT_TRANSLATION.LAYOUT = client.layout_type
def get_lang_json(lang: str) -> translations.JsonDef: def get_lang_json(lang: str) -> translations.JsonDef: