From eeb9b3c9ed17f35531485f32cc2456063d1956aa Mon Sep 17 00:00:00 2001 From: grdddj Date: Tue, 12 Sep 2023 14:22:43 +0200 Subject: [PATCH] WIP - fix broken translations --- core/embed/rust/src/ui/translations/cs.json | 4 +++- core/embed/rust/src/ui/translations/cs.rs | 4 +++- core/embed/rust/src/ui/translations/en.json | 8 +++++--- core/embed/rust/src/ui/translations/en.rs | 8 +++++--- core/embed/rust/src/ui/translations/en_merged.json | 2 +- core/embed/rust/src/ui/translations/export.rs | 4 +++- core/embed/rust/src/ui/translations/fr.json | 2 +- core/embed/rust/src/ui/translations/fr.rs | 2 +- core/embed/rust/src/ui/translations/general.rs | 8 ++++++-- core/mocks/generated/trezortranslate.pyi | 4 +++- core/src/apps/common/request_pin.py | 2 +- core/src/trezor/ui/layouts/tr/__init__.py | 2 +- core/src/trezor/ui/layouts/tt_v2/__init__.py | 8 ++++---- 13 files changed, 37 insertions(+), 21 deletions(-) diff --git a/core/embed/rust/src/ui/translations/cs.json b/core/embed/rust/src/ui/translations/cs.json index 7952c8ca78d..84673a33634 100644 --- a/core/embed/rust/src/ui/translations/cs.json +++ b/core/embed/rust/src/ui/translations/cs.json @@ -280,6 +280,7 @@ "enter_new": "Zadejte nový PIN", "reenter_new": "Znovu PIN", "invalid_pin": "Neplatný PIN", + "entered_not_valid": "Zadaný PIN není platný.", "diff_from_wipe_code": "PIN nesmí být stejný jako kód pro vymazání.", "change": "Změnit PIN?", "info": "PIN bude vyžadován pro přístup k tomuto zařízení.", @@ -343,7 +344,7 @@ }, "address": { "title_receive_address": "ADRESA PRO PŘIJETÍ", - "confirm_public_key": "Potvrdit veřejný klíč", + "public_key": "Veřejný klíč", "title_yours": "VAŠE", "title_cosigner": "SPOLUPODEPSÁNÍ", "address": "Adresa:" @@ -464,6 +465,7 @@ "wipe_code": { "title_check": "ZKONTROLOVAT KÓD PRO VYMAZÁNÍ", "title_invalid": "NEPLATNÝ KÓD PRO VYMAZÁNÍ", + "invalid": "Neplatný kód pro vymazání", "title_settings": "NASTAVENÍ KÓDU PRO VYMAZÁNÍ", "changed": "Kód pro vymazání změněn", "enabled": "Kód pro vymazání povolen.", diff --git a/core/embed/rust/src/ui/translations/cs.rs b/core/embed/rust/src/ui/translations/cs.rs index 5cdbbb32997..d225f905d4c 100644 --- a/core/embed/rust/src/ui/translations/cs.rs +++ b/core/embed/rust/src/ui/translations/cs.rs @@ -15,7 +15,7 @@ pub const TRANSLATIONS: TranslationsGeneral = TranslationsGeneral { addr_mismatch__wrong_derication_path: "Špatná derivační cesta pro zvolený účet.", addr_mismatch__xpub_mismatch: "Nesouhlasí XPUB?", address__address: "Adresa:", - address__confirm_public_key: "Potvrdit veřejný klíč", + address__public_key: "Veřejný klíč", address__title_cosigner: "SPOLUPODEPSÁNÍ", address__title_receive_address: "ADRESA PRO PŘIJETÍ", address__title_yours: "VAŠE", @@ -476,6 +476,7 @@ pub const TRANSLATIONS: TranslationsGeneral = TranslationsGeneral { pin__enabled: "Ochrana PIN zapnuta.", pin__enter: "Zadat PIN", pin__enter_new: "Zadejte nový PIN", + pin__entered_not_valid: "Zadaný PIN není platný.", pin__info: "PIN bude vyžadován pro přístup k tomuto zařízení.", pin__invalid_pin: "Neplatný PIN", pin__last_attempt: "Poslední pokus", @@ -769,6 +770,7 @@ pub const TRANSLATIONS: TranslationsGeneral = TranslationsGeneral { wipe_code__enabled: "Kód pro vymazání povolen.", wipe_code__enter_new: "Zadejte nový kód pro vymazání", wipe_code__info: "Kód pro vymazání lze použít k vymazání všech dat z tohoto zařízení.", + wipe_code__invalid: "Neplatný kód pro vymazání", wipe_code__mismatch: "Zadané kódy pro vymazání nesouhlasí!", wipe_code__reenter: "Znovu zadejte kód pro vymazání", wipe_code__reenter_to_confirm: "Pro potvrzení znovu zadejte kód pro vymazání.", diff --git a/core/embed/rust/src/ui/translations/en.json b/core/embed/rust/src/ui/translations/en.json index 4abb7623bee..35c352e265d 100644 --- a/core/embed/rust/src/ui/translations/en.json +++ b/core/embed/rust/src/ui/translations/en.json @@ -146,7 +146,7 @@ "title_key_mismatch": "KEY MISMATCH?", "contact_support": "Please contact Trezor support at", "support_url": "trezor.io/support", - "wrong_derication_path": "Wrong derivation path for selected account" + "wrong_derication_path": "Wrong derivation path for selected account." }, "coinjoin": { "title": "AUTHORIZE COINJOIN", @@ -279,7 +279,8 @@ "enter": "Enter PIN", "enter_new": "Enter new PIN", "reenter_new": "Re-enter new PIN", - "invalid_pin": "The PIN you have entered is not valid.", + "invalid_pin": "Invalid PIN", + "entered_not_valid": "The PIN you have entered is not valid.", "diff_from_wipe_code": "The new PIN must be different from your wipe code.", "change": "Change PIN?", "info": "PIN will be required to access this device.", @@ -343,7 +344,7 @@ }, "address": { "title_receive_address": "RECEIVE ADDRESS", - "confirm_public_key": "Confirm public key", + "public_key": "Public key", "title_yours": "YOURS", "title_cosigner": "COSIGNER", "address": "Address:" @@ -464,6 +465,7 @@ "wipe_code": { "title_check": "CHECK WIPE CODE", "title_invalid": "INVALID WIPE CODE", + "invalid": "Invalid wipe code", "title_settings": "WIPE CODE SETTINGS", "changed": "Wipe code changed.", "enabled": "Wipe code enabled.", diff --git a/core/embed/rust/src/ui/translations/en.rs b/core/embed/rust/src/ui/translations/en.rs index 3389ccf3a3c..1f9105e21b8 100644 --- a/core/embed/rust/src/ui/translations/en.rs +++ b/core/embed/rust/src/ui/translations/en.rs @@ -12,10 +12,10 @@ pub const TRANSLATIONS: TranslationsGeneral = TranslationsGeneral { addr_mismatch__support_url: "trezor.io/support", addr_mismatch__title: "ADDRESS MISMATCH?", addr_mismatch__title_key_mismatch: "KEY MISMATCH?", - addr_mismatch__wrong_derication_path: "Wrong derivation path for selected account", + addr_mismatch__wrong_derication_path: "Wrong derivation path for selected account.", addr_mismatch__xpub_mismatch: "XPUB mismatch?", address__address: "Address:", - address__confirm_public_key: "Confirm public key", + address__public_key: "Public key", address__title_cosigner: "COSIGNER", address__title_receive_address: "RECEIVE ADDRESS", address__title_yours: "YOURS", @@ -476,8 +476,9 @@ pub const TRANSLATIONS: TranslationsGeneral = TranslationsGeneral { pin__enabled: "PIN protection\nturned on.", pin__enter: "Enter PIN", pin__enter_new: "Enter new PIN", + pin__entered_not_valid: "The PIN you have entered is not valid.", pin__info: "PIN will be required to access this device.", - pin__invalid_pin: "The PIN you have entered is not valid.", + pin__invalid_pin: "Invalid PIN", pin__last_attempt: "Last attempt", pin__mismatch: "Entered PINs do not match!", pin__please_check_again: "Please check again.", @@ -769,6 +770,7 @@ pub const TRANSLATIONS: TranslationsGeneral = TranslationsGeneral { wipe_code__enabled: "Wipe code enabled.", wipe_code__enter_new: "Enter new wipe code", wipe_code__info: "Wipe code can be used to erase all data from this device.", + wipe_code__invalid: "Invalid wipe code", wipe_code__mismatch: "Entered wipe codes do not match!", wipe_code__reenter: "Re-enter wipe code", wipe_code__reenter_to_confirm: "Please re-enter wipe code to confirm.", diff --git a/core/embed/rust/src/ui/translations/en_merged.json b/core/embed/rust/src/ui/translations/en_merged.json index 4cd2457a78f..52dd041dc6b 100644 --- a/core/embed/rust/src/ui/translations/en_merged.json +++ b/core/embed/rust/src/ui/translations/en_merged.json @@ -339,7 +339,7 @@ }, "address": { "title_receive_address": "RECEIVE ADDRESS", - "confirm_public_key": "Confirm public key", + "public_key": "Confirm public key", "title_yours": "YOURS", "title_cosigner": "COSIGNER", "address": "Address:" diff --git a/core/embed/rust/src/ui/translations/export.rs b/core/embed/rust/src/ui/translations/export.rs index f473d83aee1..da4cd2a2b2a 100644 --- a/core/embed/rust/src/ui/translations/export.rs +++ b/core/embed/rust/src/ui/translations/export.rs @@ -19,7 +19,7 @@ pub static mp_module_trezortranslate: Module = obj_module! { /// "addr_mismatch__wrong_derication_path", /// "addr_mismatch__xpub_mismatch", /// "address__address", - /// "address__confirm_public_key", + /// "address__public_key", /// "address__title_cosigner", /// "address__title_receive_address", /// "address__title_yours", @@ -480,6 +480,7 @@ pub static mp_module_trezortranslate: Module = obj_module! { /// "pin__enabled", /// "pin__enter", /// "pin__enter_new", + /// "pin__entered_not_valid", /// "pin__info", /// "pin__invalid_pin", /// "pin__last_attempt", @@ -773,6 +774,7 @@ pub static mp_module_trezortranslate: Module = obj_module! { /// "wipe_code__enabled", /// "wipe_code__enter_new", /// "wipe_code__info", + /// "wipe_code__invalid", /// "wipe_code__mismatch", /// "wipe_code__reenter", /// "wipe_code__reenter_to_confirm", diff --git a/core/embed/rust/src/ui/translations/fr.json b/core/embed/rust/src/ui/translations/fr.json index 46151b323c1..e6667edfe84 100644 --- a/core/embed/rust/src/ui/translations/fr.json +++ b/core/embed/rust/src/ui/translations/fr.json @@ -339,7 +339,7 @@ }, "address": { "title_receive_address": "Recevoir l'adresse", - "confirm_public_key": "Confirmer la clé publique", + "public_key": "Confirmer la clé publique", "title_yours": "LE VÔTRE", "title_cosigner": "Cosignataire", "address": "Adresse:" diff --git a/core/embed/rust/src/ui/translations/fr.rs b/core/embed/rust/src/ui/translations/fr.rs index 31bd9a51a33..2a9adc03b9f 100644 --- a/core/embed/rust/src/ui/translations/fr.rs +++ b/core/embed/rust/src/ui/translations/fr.rs @@ -11,7 +11,7 @@ pub const TRANSLATIONS: TranslationsGeneral = TranslationsGeneral { addr_mismatch__support_url: "Translation failed: list index out of range", addr_mismatch__title: "ADRESSER L'AFFICATION?", address__address: "Adresse:", - address__confirm_public_key: "Confirmer la clé publique", + address__public_key: "Confirmer la clé publique", address__title_cosigner: "Cosignataire", address__title_receive_address: "Recevoir l'adresse", address__title_yours: "LE VÔTRE", diff --git a/core/embed/rust/src/ui/translations/general.rs b/core/embed/rust/src/ui/translations/general.rs index 9c448c7deef..844e3f97eac 100644 --- a/core/embed/rust/src/ui/translations/general.rs +++ b/core/embed/rust/src/ui/translations/general.rs @@ -25,7 +25,7 @@ pub struct TranslationsGeneral { pub addr_mismatch__wrong_derication_path: &'static str, pub addr_mismatch__xpub_mismatch: &'static str, pub address__address: &'static str, - pub address__confirm_public_key: &'static str, + pub address__public_key: &'static str, pub address__title_cosigner: &'static str, pub address__title_receive_address: &'static str, pub address__title_yours: &'static str, @@ -486,6 +486,7 @@ pub struct TranslationsGeneral { pub pin__enabled: &'static str, pub pin__enter: &'static str, pub pin__enter_new: &'static str, + pub pin__entered_not_valid: &'static str, pub pin__info: &'static str, pub pin__invalid_pin: &'static str, pub pin__last_attempt: &'static str, @@ -779,6 +780,7 @@ pub struct TranslationsGeneral { pub wipe_code__enabled: &'static str, pub wipe_code__enter_new: &'static str, pub wipe_code__info: &'static str, + pub wipe_code__invalid: &'static str, pub wipe_code__mismatch: &'static str, pub wipe_code__reenter: &'static str, pub wipe_code__reenter_to_confirm: &'static str, @@ -827,7 +829,7 @@ impl TranslationsGeneral { "addr_mismatch__wrong_derication_path" => Some(self.addr_mismatch__wrong_derication_path), "addr_mismatch__xpub_mismatch" => Some(self.addr_mismatch__xpub_mismatch), "address__address" => Some(self.address__address), - "address__confirm_public_key" => Some(self.address__confirm_public_key), + "address__public_key" => Some(self.address__public_key), "address__title_cosigner" => Some(self.address__title_cosigner), "address__title_receive_address" => Some(self.address__title_receive_address), "address__title_yours" => Some(self.address__title_yours), @@ -1288,6 +1290,7 @@ impl TranslationsGeneral { "pin__enabled" => Some(self.pin__enabled), "pin__enter" => Some(self.pin__enter), "pin__enter_new" => Some(self.pin__enter_new), + "pin__entered_not_valid" => Some(self.pin__entered_not_valid), "pin__info" => Some(self.pin__info), "pin__invalid_pin" => Some(self.pin__invalid_pin), "pin__last_attempt" => Some(self.pin__last_attempt), @@ -1581,6 +1584,7 @@ impl TranslationsGeneral { "wipe_code__enabled" => Some(self.wipe_code__enabled), "wipe_code__enter_new" => Some(self.wipe_code__enter_new), "wipe_code__info" => Some(self.wipe_code__info), + "wipe_code__invalid" => Some(self.wipe_code__invalid), "wipe_code__mismatch" => Some(self.wipe_code__mismatch), "wipe_code__reenter" => Some(self.wipe_code__reenter), "wipe_code__reenter_to_confirm" => Some(self.wipe_code__reenter_to_confirm), diff --git a/core/mocks/generated/trezortranslate.pyi b/core/mocks/generated/trezortranslate.pyi index 882bd45b6fc..82b43874bcf 100644 --- a/core/mocks/generated/trezortranslate.pyi +++ b/core/mocks/generated/trezortranslate.pyi @@ -12,7 +12,7 @@ def tr(key: Literal[ "addr_mismatch__wrong_derication_path", "addr_mismatch__xpub_mismatch", "address__address", - "address__confirm_public_key", + "address__public_key", "address__title_cosigner", "address__title_receive_address", "address__title_yours", @@ -473,6 +473,7 @@ def tr(key: Literal[ "pin__enabled", "pin__enter", "pin__enter_new", + "pin__entered_not_valid", "pin__info", "pin__invalid_pin", "pin__last_attempt", @@ -766,6 +767,7 @@ def tr(key: Literal[ "wipe_code__enabled", "wipe_code__enter_new", "wipe_code__info", + "wipe_code__invalid", "wipe_code__mismatch", "wipe_code__reenter", "wipe_code__reenter_to_confirm", diff --git a/core/src/apps/common/request_pin.py b/core/src/apps/common/request_pin.py index fd7c96ac5b8..eb35ed567c3 100644 --- a/core/src/apps/common/request_pin.py +++ b/core/src/apps/common/request_pin.py @@ -129,7 +129,7 @@ async def verify_user_pin( async def error_pin_invalid() -> NoReturn: await show_error_and_raise( "warning_wrong_pin", - TR.tr("pin__invalid_pin"), + TR.tr("pin__entered_not_valid"), TR.tr("pin__wrong_pin"), # header exc=wire.PinInvalid, ) diff --git a/core/src/trezor/ui/layouts/tr/__init__.py b/core/src/trezor/ui/layouts/tr/__init__.py index 9a60354b3ba..372f0236363 100644 --- a/core/src/trezor/ui/layouts/tr/__init__.py +++ b/core/src/trezor/ui/layouts/tr/__init__.py @@ -535,7 +535,7 @@ def xpub_title(i: int) -> str: def show_pubkey( pubkey: str, - title: str = TR.tr("address__confirm_public_key"), + title: str = TR.tr("address__public_key"), *, account: str | None = None, path: str | None = None, diff --git a/core/src/trezor/ui/layouts/tt_v2/__init__.py b/core/src/trezor/ui/layouts/tt_v2/__init__.py index fb628f991b1..6798bd88b9e 100644 --- a/core/src/trezor/ui/layouts/tt_v2/__init__.py +++ b/core/src/trezor/ui/layouts/tt_v2/__init__.py @@ -490,7 +490,7 @@ def xpub_title(i: int) -> str: def show_pubkey( pubkey: str, - title: str = TR.tr("address__confirm_public_key"), + title: str = TR.tr("address__public_key"), *, account: str | None = None, path: str | None = None, @@ -591,8 +591,8 @@ async def confirm_output( amount_title = title.upper() recipient_title = title.upper() elif output_index is not None: - amount_title = TR.tr("send__title_amount") + f"#{output_index + 1}" - recipient_title = TR.tr("send__title_recipient") + f"#{output_index + 1}" + amount_title = f"{TR.tr('send__title_amount') } #{output_index + 1}" + recipient_title = f"{TR.tr('send__title_recipient')} #{output_index + 1}" else: amount_title = TR.tr("send__confirm_sending") recipient_title = TR.tr("send__title_sending_to") @@ -1285,7 +1285,7 @@ async def pin_mismatch_popup( async def wipe_code_same_as_pin_popup() -> None: await button_request("wipe_code_same_as_pin", code=BR_TYPE_OTHER) return await show_error_popup( - TR.tr("wipe_code__title_invalid"), + TR.tr("wipe_code__invalid"), TR.tr("wipe_code__diff_from_pin"), button=TR.tr("buttons__try_again"), )