Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core/ui): fix a few translation strings #4238

Merged
merged 5 commits into from
Oct 10, 2024
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
1 change: 1 addition & 0 deletions core/.changelog.d/3947.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[T3T1] Fix XPUB confirmed success screen title
3 changes: 3 additions & 0 deletions core/embed/rust/librust_qstr.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ static void _librust_qstrs(void) {
MP_QSTR_address__cancel_receive;
MP_QSTR_address__confirmed;
MP_QSTR_address__public_key;
MP_QSTR_address__public_key_confirmed;
MP_QSTR_address__qr_code;
MP_QSTR_address__title_cosigner;
MP_QSTR_address__title_receive_address;
Expand Down Expand Up @@ -679,6 +680,7 @@ static void _librust_qstrs(void) {
MP_QSTR_time_ms;
MP_QSTR_timer;
MP_QSTR_title;
MP_QSTR_title_success;
MP_QSTR_total_amount;
MP_QSTR_total_fee_new;
MP_QSTR_total_label;
Expand Down Expand Up @@ -764,6 +766,7 @@ static void _librust_qstrs(void) {
MP_QSTR_words__confirm_fee;
MP_QSTR_words__contains;
MP_QSTR_words__continue_anyway;
MP_QSTR_words__continue_anyway_question;
MP_QSTR_words__continue_with;
MP_QSTR_words__error;
MP_QSTR_words__fee;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ fn new_confirm_reset_obj(_args: &[Obj], kwargs: &Map) -> Result<Obj, error::Erro
(
TR::reset__title_create_wallet.into(),
ButtonRequestCode::ResetDevice.with_name("setup_device"),
// FIXME: TR::reset__cancel_create_wallet should be used but Button text on
// multiple lines not supported yet
TR::buttons__cancel.into(),
TR::reset__cancel_create_wallet.into(),
)
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ fn new_obj(_args: &[Obj], kwargs: &Map) -> Result<Obj, error::Error> {
.with_cancel_button()
.with_footer(
TR::instructions__swipe_up.into(),
Some(TR::words__continue_anyway.into()),
Some(TR::words__continue_anyway_question.into()),
)
.with_swipe(Direction::Up, SwipeSettings::default())
.with_swipe(Direction::Right, SwipeSettings::immediate())
Expand Down
4 changes: 3 additions & 1 deletion core/embed/rust/src/ui/model_mercury/flow/get_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ impl GetAddress {
let path: Option<TString> = kwargs.get(Qstr::MP_QSTR_path)?.try_into_option()?;
let xpubs: Obj = kwargs.get(Qstr::MP_QSTR_xpubs)?;

let title_success: TString = kwargs.get(Qstr::MP_QSTR_title_success)?.try_into()?;

let br_name: TString = kwargs.get(Qstr::MP_QSTR_br_name)?.try_into()?;
let br_code: u16 = kwargs.get(Qstr::MP_QSTR_br_code)?.try_into()?;

Expand Down Expand Up @@ -150,7 +152,7 @@ impl GetAddress {

let content_confirmed = Frame::left_aligned(
TR::words__title_success.into(),
StatusScreen::new_success_timeout(TR::address__confirmed.into()),
StatusScreen::new_success_timeout(title_success),
)
.with_footer(TR::instructions__continue_in_app.into(), None)
.with_result_icon(theme::ICON_BULLET_CHECKMARK, theme::GREEN_LIGHT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl PromptBackup {
.with_cancel_button()
.with_footer(
TR::instructions__swipe_up.into(),
Some(TR::words__continue_anyway.into()),
Some(TR::words__continue_anyway_question.into()),
)
.with_swipe(Direction::Up, SwipeSettings::default())
.with_swipe(Direction::Right, SwipeSettings::immediate())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ impl WarningHiPrio {
let description: TString = kwargs.get(Qstr::MP_QSTR_description)?.try_into()?;
let value: TString = kwargs.get_or(Qstr::MP_QSTR_value, "".into())?;
let cancel: TString = TR::words__cancel_and_exit.into();
let confirm: TString = "Continue anyway".into(); // FIXME: en.json has punctuation
let done_title: TString = "Operation cancelled".into();
let confirm: TString = TR::words__continue_anyway.into();
let done_title: TString = TR::words__operation_cancelled.into();

// Message
let paragraphs = [
Expand All @@ -94,7 +94,7 @@ impl WarningHiPrio {
let content_menu = Frame::left_aligned(
"".into(),
VerticalMenu::empty()
.item(theme::ICON_CANCEL, "Cancel".into()) // TODO: button__cancel after it's lowercase
.item(theme::ICON_CANCEL, TR::buttons__cancel.into())
.danger(theme::ICON_CHEVRON_RIGHT, confirm),
)
.with_cancel_button()
Expand Down
1 change: 1 addition & 0 deletions core/embed/rust/src/ui/model_mercury/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1659,6 +1659,7 @@ pub static mp_module_trezorui2: Module = obj_module! {
/// account: str | None,
/// path: str | None,
/// xpubs: list[tuple[str, str]],
/// title_success: str,
/// br_code: ButtonRequestType,
/// br_name: str,
/// ) -> LayoutObj[UiResult]:
Expand Down
1 change: 1 addition & 0 deletions core/mocks/generated/trezorui2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ def flow_get_address(
account: str | None,
path: str | None,
xpubs: list[tuple[str, str]],
title_success: str,
br_code: ButtonRequestType,
br_name: str,
) -> LayoutObj[UiResult]:
Expand Down
4 changes: 3 additions & 1 deletion core/mocks/trezortranslate_keys.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class TR:
address__cancel_receive: str = "Cancel receive"
address__confirmed: str = "Receive address confirmed"
address__public_key: str = "Public key"
address__public_key_confirmed: str = "Public key confirmed"
address__qr_code: str = "QR code"
address__title_cosigner: str = "Cosigner"
address__title_receive_address: str = "Receive address"
Expand Down Expand Up @@ -921,7 +922,8 @@ class TR:
words__confirm: str = "Confirm"
words__confirm_fee: str = "Confirm fee"
words__contains: str = "Contains"
words__continue_anyway: str = "Continue anyway?"
words__continue_anyway: str = "Continue anyway"
words__continue_anyway_question: str = "Continue anyway?"
words__continue_with: str = "Continue with"
words__error: str = "Error"
words__fee: str = "Fee"
Expand Down
6 changes: 3 additions & 3 deletions core/src/apps/bitcoin/sign_tx/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ async def confirm_unverified_external_input() -> None:
await layouts.show_warning(
"unverified_external_input",
TR.bitcoin__unverified_external_inputs,
TR.words__continue_anyway,
TR.words__continue_anyway_question,
button=TR.buttons__continue,
br_code=ButtonRequestType.SignTx,
)
Expand All @@ -294,7 +294,7 @@ async def confirm_multiple_accounts() -> None:
await layouts.show_warning(
"sending_from_multiple_accounts",
TR.send__from_multiple_accounts,
TR.words__continue_anyway,
TR.words__continue_anyway_question,
button=TR.buttons__continue,
br_code=ButtonRequestType.SignTx,
)
Expand All @@ -307,7 +307,7 @@ async def confirm_nondefault_locktime(lock_time: int, lock_time_disabled: bool)
await layouts.show_warning(
"nondefault_locktime",
TR.bitcoin__locktime_no_effect,
TR.words__continue_anyway,
TR.words__continue_anyway_question,
button=TR.buttons__continue,
br_code=ButtonRequestType.SignTx,
)
Expand Down
9 changes: 8 additions & 1 deletion core/src/trezor/ui/layouts/mercury/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,12 @@ def xpub_title(i: int) -> str:
)
return result

title_success = (
TR.address__public_key_confirmed
if title in ("XPUB", TR.address__public_key)
else TR.address__confirmed
)

await raise_if_not_confirmed(
RustLayout(
trezorui2.flow_get_address(
Expand All @@ -527,6 +533,7 @@ def xpub_title(i: int) -> str:
account=account,
path=path,
xpubs=[(xpub_title(i), xpub) for i, xpub in enumerate(xpubs)],
title_success=title_success,
br_name=br_name,
br_code=br_code,
)
Expand Down Expand Up @@ -594,7 +601,7 @@ def show_warning(
trezorui2.show_warning(
title=TR.words__important,
value=content,
button=subheader or TR.words__continue_anyway,
button=subheader or TR.words__continue_anyway_question,
danger=True,
)
),
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 @@ -517,7 +517,7 @@ def confirm_multisig_warning() -> Awaitable[None]:
return show_warning(
"warning_multisig",
TR.send__receiving_to_multisig,
TR.words__continue_anyway,
TR.words__continue_anyway_question,
)


Expand Down
4 changes: 2 additions & 2 deletions core/src/trezor/ui/layouts/tt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def confirm_path_warning(path: str, path_type: str | None = None) -> Awaitable[N
trezorui2.show_warning(
title=title,
value=path,
description=TR.words__continue_anyway,
description=TR.words__continue_anyway_question,
button=TR.buttons__continue,
)
),
Expand All @@ -450,7 +450,7 @@ def confirm_multisig_warning() -> Awaitable[None]:
return show_warning(
"warning_multisig",
TR.send__receiving_to_multisig,
TR.words__continue_anyway,
TR.words__continue_anyway_question,
)


Expand Down
1 change: 1 addition & 0 deletions core/tools/translations/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,7 @@
"words__confirm_fee": "text,1",
"words__contains": "text,1",
"words__continue_anyway": "text,1",
"words__continue_anyway_question": "text,1",
"words__continue_with": "text,1",
"words__error": "text,1",
"words__fee": "text,1",
Expand Down
4 changes: 3 additions & 1 deletion core/translations/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"address__cancel_receive": "Zrušit příjem",
"address__confirmed": "Adresa příjemce potvrzena",
"address__public_key": "Veřejný klíč",
"address__public_key_confirmed": "Veřejný klíč potvrzen",
"address__qr_code": "QR kód",
"address__title_cosigner": "Další podepisující",
"address__title_receive_address": "Přijímací adresa",
Expand Down Expand Up @@ -942,7 +943,8 @@
"words__confirm": "Potvrdit",
"words__confirm_fee": "Potvrdit poplatek",
"words__contains": "Obsahuje",
"words__continue_anyway": "Přesto pokračovat?",
"words__continue_anyway": "Přesto pokračovat",
"words__continue_anyway_question": "Přesto pokračovat?",
"words__continue_with": "Pokračovat s",
"words__error": "Chyba",
"words__fee": "Poplatek",
Expand Down
4 changes: 3 additions & 1 deletion core/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"address__cancel_receive": "Empfang abbr.",
"address__confirmed": "Empfängeradresse bestätigt",
"address__public_key": "Public Key",
"address__public_key_confirmed": "Public Key bestätigt",
"address__qr_code": "QR-Code",
"address__title_cosigner": "Mitunterzeich.",
"address__title_receive_address": "Empfäng-adresse",
Expand Down Expand Up @@ -942,7 +943,8 @@
"words__confirm": "Bestätigen",
"words__confirm_fee": "Gebühr bestätigen",
"words__contains": "Enthält",
"words__continue_anyway": "trotzdem fortfahren?",
"words__continue_anyway": "trotzdem fortfahren",
"words__continue_anyway_question": "trotzdem fortfahren?",
"words__continue_with": "Weiter mit",
"words__error": "Fehler",
"words__fee": "Gebühr",
Expand Down
4 changes: 3 additions & 1 deletion core/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"address__cancel_receive": "Cancel receive",
"address__confirmed": "Receive address confirmed",
"address__public_key": "Public key",
"address__public_key_confirmed": "Public key confirmed",
"address__qr_code": "QR code",
"address__title_cosigner": "Cosigner",
"address__title_receive_address": "Receive address",
Expand Down Expand Up @@ -923,7 +924,8 @@
"words__confirm": "Confirm",
"words__confirm_fee": "Confirm fee",
"words__contains": "Contains",
"words__continue_anyway": "Continue anyway?",
"words__continue_anyway": "Continue anyway",
"words__continue_anyway_question": "Continue anyway?",
"words__continue_with": "Continue with",
"words__error": "Error",
"words__fee": "Fee",
Expand Down
4 changes: 3 additions & 1 deletion core/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"address__cancel_receive": "Cancelar destino",
"address__confirmed": "Dirección de destino confirmada",
"address__public_key": "Clave pública",
"address__public_key_confirmed": "Clave pública confirmada",
"address__qr_code": "Código QR",
"address__title_cosigner": "Cofirmante",
"address__title_receive_address": "Dirección destino",
Expand Down Expand Up @@ -942,7 +943,8 @@
"words__confirm": "Confirmar",
"words__confirm_fee": "Confirmar comisión",
"words__contains": "Contiene",
"words__continue_anyway": "¿Continuar?",
"words__continue_anyway": "Continuar",
"words__continue_anyway_question": "¿Continuar?",
"words__continue_with": "Continuar con",
"words__error": "Error",
"words__fee": "Comisión",
Expand Down
4 changes: 3 additions & 1 deletion core/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"address__cancel_receive": "Annuler réception",
"address__confirmed": "Adresse de réception confirmée",
"address__public_key": "Clé publique",
"address__public_key_confirmed": "Clé publique confirmée",
"address__qr_code": "Code QR",
"address__title_cosigner": "Cosignataire",
"address__title_receive_address": "Adr. de récep.",
Expand Down Expand Up @@ -942,7 +943,8 @@
"words__confirm": "Conf.",
"words__confirm_fee": "Conf. les frais",
"words__contains": "Contient",
"words__continue_anyway": "Continuer qdm ?",
"words__continue_anyway": "Continuer qdm",
"words__continue_anyway_question": "Continuer qdm ?",
"words__continue_with": "Continuer avec",
"words__error": "Erreur",
"words__fee": "Frais",
Expand Down
6 changes: 5 additions & 1 deletion core/translations/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"addr_mismatch__wrong_derivation_path": "Percorso deriv. errato per conto selezion.",
"addr_mismatch__xpub_mismatch": "XPUB non corrisp.?",
"address__public_key": "Chiave pubblica",
"address__public_key_confirmed": "Chiave pubblica confermata",
"address__title_cosigner": "Cofirmatario",
"address__title_receive_address": "Indirizzo ricez.",
"address__title_yours": "I tuoi",
Expand Down Expand Up @@ -393,6 +394,7 @@
"inputs__return": "INDIETRO",
"inputs__show": "MOSTRA",
"inputs__space": "SPAZIO",
"instructions__continue_in_app": "Continua nell'app",
"instructions__exit_tutorial": "Esci dal tutorial",
"joint__title": "Transaz. congiunta",
"joint__to_the_total_amount": "Fino all'importo totale:",
Expand Down Expand Up @@ -717,6 +719,7 @@
"send__to_the_total_amount": "Fino all'importo totale:",
"send__total_amount": "Importo totale:",
"send__transaction_id": "ID transazione:",
"send__transaction_signed": "Transazione firmata",
"send__you_are_contributing": "Stai contribuendo con:",
"share_words__words_in_order": " parole nell'ordine.",
"share_words__wrote_down_all": "Ho annotato tutto ",
Expand Down Expand Up @@ -882,7 +885,8 @@
"words__confirm": "Conferma",
"words__confirm_fee": "Conferma commissione",
"words__contains": "Contiene",
"words__continue_anyway": "Continuare comunque?",
"words__continue_anyway": "Continuare comunque",
"words__continue_anyway_question": "Continuare comunque?",
"words__continue_with": "Continua con",
"words__error": "Errore",
"words__fee": "Commissione",
Expand Down
Loading
Loading