Skip to content

Commit

Permalink
WIP - fix broken translations
Browse files Browse the repository at this point in the history
  • Loading branch information
grdddj committed Sep 12, 2023
1 parent 8b2081e commit eeb9b3c
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 21 deletions.
4 changes: 3 additions & 1 deletion core/embed/rust/src/ui/translations/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -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í.",
Expand Down Expand Up @@ -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:"
Expand Down Expand Up @@ -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.",
Expand Down
4 changes: 3 additions & 1 deletion core/embed/rust/src/ui/translations/cs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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í.",
Expand Down
8 changes: 5 additions & 3 deletions core/embed/rust/src/ui/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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.",
Expand Down Expand Up @@ -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:"
Expand Down Expand Up @@ -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.",
Expand Down
8 changes: 5 additions & 3 deletions core/embed/rust/src/ui/translations/en.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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.",
Expand Down Expand Up @@ -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.",
Expand Down
2 changes: 1 addition & 1 deletion core/embed/rust/src/ui/translations/en_merged.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand Down
4 changes: 3 additions & 1 deletion core/embed/rust/src/ui/translations/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion core/embed/rust/src/ui/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand Down
2 changes: 1 addition & 1 deletion core/embed/rust/src/ui/translations/fr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 6 additions & 2 deletions core/embed/rust/src/ui/translations/general.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down
4 changes: 3 additions & 1 deletion core/mocks/generated/trezortranslate.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion core/src/apps/common/request_pin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
2 changes: 1 addition & 1 deletion core/src/trezor/ui/layouts/tr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions core/src/trezor/ui/layouts/tt_v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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"),
)
Expand Down

0 comments on commit eeb9b3c

Please sign in to comment.