mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-17 10:51:00 +00:00
fix(core/translations): preserve model groups when running cli.py gen
[no changelog]
This commit is contained in:
parent
5bc2f8d1ec
commit
0f8a2955ec
@ -124,11 +124,11 @@ class TranslationsDir:
|
||||
def _lang_path(self, lang: str) -> Path:
|
||||
return self.path / f"{lang}.json"
|
||||
|
||||
def load_lang(self, lang: str) -> translations.JsonDef:
|
||||
def load_lang(self, lang: str, model_groups: bool = True) -> translations.JsonDef:
|
||||
json_def = json.loads(self._lang_path(lang).read_text())
|
||||
# special-case for T2B1 and T3B1, so that we keep the info in one place instead
|
||||
# of duplicating it in two entries, risking a desync
|
||||
if (fonts_safe3 := json_def.get("fonts", {}).get("##Safe3")) is not None:
|
||||
if model_groups and (fonts_safe3 := json_def.get("fonts", {}).get("##Safe3")) is not None:
|
||||
json_def["fonts"]["T2B1"] = fonts_safe3
|
||||
json_def["fonts"]["T3B1"] = fonts_safe3
|
||||
return json_def
|
||||
@ -150,7 +150,7 @@ class TranslationsDir:
|
||||
def update_version_from_h(self, check: bool = False) -> VersionTuple:
|
||||
version = _version_from_version_h()
|
||||
for lang in self.all_languages():
|
||||
blob_json = self.load_lang(lang)
|
||||
blob_json = self.load_lang(lang, model_groups=False)
|
||||
blob_version = translations.version_from_json(
|
||||
blob_json["header"]["version"]
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user