feat(fw): signal translations production status - #179
Conversation
obrusvit
commented
Aug 11, 2026
- complementary commit to https://github.com/trezor/trezor-suite-firmware-release/pull/223
853322a to
5378811
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the firmware release metadata pipeline to propagate per-translation quality information (translations_status) into the legacy releases.json, and documents the new field in the firmware data README. This aligns metadata produced by copy-firmware-jsons.py with Suite’s UI needs (per linked complementary PR).
Changes:
- Copy
translations_statusfrom per-release JSONs into legacyreleases.json, while keepingtranslationsreduced to a list of language tags. - Add README documentation describing
translations_statussemantics and how it is represented in legacy vs per-release JSONs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/copy-firmware-jsons.py | Adds copying/validation of translations_status into the legacy releases.json entry. |
| firmware/README.md | Documents the translations_status field and its relationship to translations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if (translations_status := universal_json.get("translations_status")) is not None: | ||
| # translations_status must list every language present in translations | ||
| assert translations is not None | ||
| assert set(translations_status) == set(translations) | ||
| new_item["translations_status"] = translations_status # keep the map as-is |
|
|
||
| Directory `translations` holds translation blobs. These are not available for T1B1 and older firmware versions. Trezor Suite downloads translations from [https://data.trezor.io/](https://data.trezor.io/). During the initial firmware installation, Suite downloads and installs a firmware translation corresponding to the Suite language, if available. The file is silently updated during subsequent firmware installations or any call to Trezor Connect, if needed. If a translation download fails, no error is shown and the outdated version is kept, which may result in some strings not being translated. | ||
|
|
||
| Per-release JSONs may also contain a `translations_status` map alongside `translations`, listing their quality level, e.g. `"translations_status": {"cs-CZ": "production", "de-DE": "beta"}`. The keys of `translations_status` always match the keys of `translations`. Trezor Suite displays a production status label for it (e.g. "Beta") based on this field. The legacy `releases.json` keeps `translations_status` as the same map, while `translations` is reduced to a list of all language tags. |
romanz
left a comment
There was a problem hiding this comment.
Let's update it following https://github.com/trezor/trezor-suite-firmware-release/pull/227.
5378811 to
8c6c2f9
Compare
|
Updated and force-pushed. |
|
@romanz thanks, done on rebase diff --git a/scripts/copy-firmware-jsons.py b/scripts/copy-firmware-jsons.py
index 2cf501b..94212a6 100755
--- a/scripts/copy-firmware-jsons.py
+++ b/scripts/copy-firmware-jsons.py
@@ -14,10 +14,10 @@ Usage:
from __future__ import annotations
import json
-import typing as t
-import subprocess
-import shutil
import re
+import shutil
+import subprocess
+import typing as t
from pathlib import Path
import click
@@ -93,13 +93,13 @@ def update_releases_json(
new_item["translations"] = list(translations) # keep only the keys
# metadata of each translation (e.g. {"status": "production"} or {"status": "beta"})
- assert universal_json.get("translations_metadata") == btconly_json.get(
- "translations_metadata"
- )
- if (metadata := universal_json.get("translations_metadata")) is not None:
+ metadata = universal_json.get("translations_metadata")
+ assert metadata == btconly_json.get("translations_metadata")
+ if metadata is not None:
# translations_metadata must list every language present in translations
assert translations is not None
- assert set(metadata) == set(translations)
+ assert set(metadata.keys()) == set(translations.keys())
new_item["translations_metadata"] = metadata # keep the map as-is
for suffix, items in [("", universal_json), ("_bitcoinonly", btconly_json)]: |
8c6c2f9 to
96268a0
Compare
- complementary commit to trezor/trezor-suite-firmware-release#223
96268a0 to
de7f5b5
Compare