Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions firmware/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ File `authenticity.json` is the source of truth for public keys used in the devi

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_metadata` map alongside `translations`, holding metadata for each language, e.g. `"translations_metadata": {"cs-CZ": {"status": "production"}, "de-DE": {"status": "beta"}}`. The keys of `translations_metadata` 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_metadata` as the same map, while `translations` is reduced to a list of all language tags.

## Models mapping

| Model | Name |
Expand Down
15 changes: 12 additions & 3 deletions scripts/copy-firmware-jsons.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
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
Expand Down Expand Up @@ -92,6 +92,15 @@ def update_releases_json(
if (translations := universal_json.get("translations")) is not None:
new_item["translations"] = list(translations) # keep only the keys

# metadata of each translation (e.g. {"status": "production"} or {"status": "beta"})
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.keys()) == set(translations.keys())
new_item["translations_metadata"] = metadata # keep the map as-is

for suffix, items in [("", universal_json), ("_bitcoinonly", btconly_json)]:
for k in non_shared_keys:
value = items[k]
Expand Down
Loading