refactor(core): render translated strings verbatim in layouts
What changed, and why it matters
This is a cosmetic code cleanup. It moves punctuation and capitalization out of the Python code and into the translation files so translated strings are shown exactly as written. There is no security-relevant change.
No security action needed. Treat as normal UI refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit refactors UI layout code for four Trezor device themes (Bolt, Caesar, Delizia, Eckhart). Previously, code wrapped translation strings in parentheses or lowercased them; now the translation strings themselves contain the parentheses and intended case. en.json is updated so ‘Yours’ becomes ‘(yours)’ and ‘Cosigner’ becomes ‘(cosigner)’. This is a pure presentation refactor with identical runtime output.
Changed components
core/src/trezor/ui/layouts/bolt/__init__.pycore/src/trezor/ui/layouts/caesar/__init__.pycore/src/trezor/ui/layouts/delizia/__init__.pycore/src/trezor/ui/layouts/eckhart/__init__.pycore/translations/en.jsonInspect captured patch +12 / −12
### core/src/trezor/ui/layouts/bolt/__init__.py
@@ -357,9 +357,9 @@ async def show_address(
def xpub_title(i: int) -> str:
result = f"MULTISIG XPUB #{i + 1}\n"
result += (
- f"({TR.address__title_yours})"
+ TR.address__title_yours
if i == multisig_index
- else f"({TR.address__title_cosigner})"
+ else TR.address__title_cosigner
)
return result
### core/src/trezor/ui/layouts/caesar/__init__.py
@@ -363,11 +363,11 @@ async def show_address(
def xpub_title(i: int) -> str:
# Will be marquee (cannot fit one line)
- result = f"MULTISIG XPUB #{i + 1}"
+ result = f"MULTISIG XPUB #{i + 1} "
result += (
- f" ({TR.address__title_yours})"
+ TR.address__title_yours
if i == multisig_index
- else f" ({TR.address__title_cosigner})"
+ else TR.address__title_cosigner
)
return result
### core/src/trezor/ui/layouts/delizia/__init__.py
@@ -182,7 +182,7 @@ def confirm_multisig_warning() -> Awaitable[None]:
async def confirm_multisig_different_paths_warning() -> None:
with trezorui_api.show_danger(
- title=f"{TR.words__important}!",
+ title=TR.words__important,
description=TR.send__multisig_different_paths,
) as layout:
return await raise_if_not_confirmed(
@@ -331,9 +331,9 @@ async def show_address(
def xpub_title(i: int) -> str:
result = f"Multisig XPUB #{i + 1}\n"
result += (
- f"({TR.address__title_yours.lower()})"
+ TR.address__title_yours
if i == multisig_index
- else f"({TR.address__title_cosigner.lower()})"
+ else TR.address__title_cosigner
)
return result
### core/src/trezor/ui/layouts/eckhart/__init__.py
@@ -286,9 +286,9 @@ async def show_address(
def xpub_title(i: int) -> str:
result = f"Multisig XPUB #{i + 1}\n"
result += (
- f"({TR.address__title_yours.lower()})"
+ TR.address__title_yours
if i == multisig_index
- else f"({TR.address__title_cosigner.lower()})"
+ else TR.address__title_cosigner
)
return result
### core/translations/en.json
@@ -48,12 +48,12 @@
"Eckhart": "Public key confirmed"
},
"address__qr_code": "QR code",
- "address__title_cosigner": "Cosigner",
+ "address__title_cosigner": "(cosigner)",
"address__title_cosigner_template": "Cosigner {0}",
"address__title_provider_address": "Provider address",
"address__title_receive_address": "Receive address",
"address__title_refund_address": "Refund address",
- "address__title_yours": "Yours",
+ "address__title_yours": "(yours)",
"address__warning_not_yours": {
"Bolt": "",
"Caesar": "",Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.