Skip to content

feat(fw): signal translations production status - #179

Merged
vdovhanych merged 1 commit into
masterfrom
obrusvit/translations-status
Aug 18, 2026
Merged

vdovhanych merged 1 commit into
masterfrom
obrusvit/translations-status

Conversation

@obrusvit

Copy link
Copy Markdown
Contributor

@obrusvit
obrusvit force-pushed the obrusvit/translations-status branch from 853322a to 5378811 Compare August 17, 2026 14:31
@obrusvit obrusvit self-assigned this Aug 17, 2026
@obrusvit
obrusvit marked this pull request as ready for review August 18, 2026 07:57
@obrusvit
obrusvit requested review from romanz and a lite review from Copilot August 18, 2026 07:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_status from per-release JSONs into legacy releases.json, while keeping translations reduced to a list of language tags.
  • Add README documentation describing translations_status semantics 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.

Comment thread scripts/copy-firmware-jsons.py Outdated
Comment on lines +99 to +103
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
Comment thread firmware/README.md Outdated

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 romanz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@obrusvit
obrusvit force-pushed the obrusvit/translations-status branch from 5378811 to 8c6c2f9 Compare August 18, 2026 08:55
@obrusvit

Copy link
Copy Markdown
Contributor Author

Updated and force-pushed.

romanz
romanz previously approved these changes Aug 18, 2026
Comment thread scripts/copy-firmware-jsons.py Outdated
Comment thread scripts/copy-firmware-jsons.py Outdated
@obrusvit

Copy link
Copy Markdown
Contributor Author

@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)]:

@vdovhanych
vdovhanych merged commit afa0bea into master Aug 18, 2026
3 checks passed
@vdovhanych
vdovhanych deleted the obrusvit/translations-status branch August 18, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants