mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-19 05:58:09 +00:00
refactor(core): use a template to add colon to strings
[no changelog]
This commit is contained in:
parent
24a15c3a05
commit
1c7bfdb04c
@ -311,6 +311,7 @@ static void _librust_qstrs(void) {
|
||||
MP_QSTR_joint__to_the_total_amount;
|
||||
MP_QSTR_joint__you_are_contributing;
|
||||
MP_QSTR_label;
|
||||
MP_QSTR_label_with_colon_template;
|
||||
MP_QSTR_language;
|
||||
MP_QSTR_language__change_to_template;
|
||||
MP_QSTR_language__changed;
|
||||
|
@ -171,7 +171,7 @@ pub enum TranslatedString {
|
||||
#[cfg(feature = "universal_fw")]
|
||||
cardano__collateral_return = 124, // "Collateral return"
|
||||
#[cfg(feature = "universal_fw")]
|
||||
cardano__confirm = 125, // "Confirm:"
|
||||
cardano__confirm = 125, // "\"\""
|
||||
#[cfg(feature = "universal_fw")]
|
||||
cardano__confirm_signing_stake_pool = 126, // "Confirm signing the stake pool registration as an owner."
|
||||
#[cfg(feature = "universal_fw")]
|
||||
@ -940,7 +940,7 @@ pub enum TranslatedString {
|
||||
send__title_sending_amount = 650, // "Sending amount"
|
||||
send__title_sending_to = 651, // "Sending to"
|
||||
send__to_the_total_amount = 652, // "To the total amount:"
|
||||
send__total_amount_colon = 653, // "Total amount:"
|
||||
send__total_amount_colon = 653, // "\"\""
|
||||
send__transaction_id = 654, // "Transaction ID:"
|
||||
send__you_are_contributing = 655, // "You are contributing:"
|
||||
share_words__words_in_order = 656, // " words in order."
|
||||
@ -1369,6 +1369,7 @@ pub enum TranslatedString {
|
||||
instructions__swipe_down = 964, // "Swipe down"
|
||||
#[cfg(feature = "universal_fw")]
|
||||
fido__title_credential_details = 965, // "Credential details"
|
||||
label_with_colon_template = 966, // "{0}:"
|
||||
}
|
||||
|
||||
impl TranslatedString {
|
||||
@ -1534,7 +1535,7 @@ impl TranslatedString {
|
||||
#[cfg(feature = "universal_fw")]
|
||||
Self::cardano__collateral_return => "Collateral return",
|
||||
#[cfg(feature = "universal_fw")]
|
||||
Self::cardano__confirm => "Confirm:",
|
||||
Self::cardano__confirm => "\"\"",
|
||||
#[cfg(feature = "universal_fw")]
|
||||
Self::cardano__confirm_signing_stake_pool => "Confirm signing the stake pool registration as an owner.",
|
||||
#[cfg(feature = "universal_fw")]
|
||||
@ -2303,7 +2304,7 @@ impl TranslatedString {
|
||||
Self::send__title_sending_amount => "Sending amount",
|
||||
Self::send__title_sending_to => "Sending to",
|
||||
Self::send__to_the_total_amount => "To the total amount:",
|
||||
Self::send__total_amount_colon => "Total amount:",
|
||||
Self::send__total_amount_colon => "\"\"",
|
||||
Self::send__transaction_id => "Transaction ID:",
|
||||
Self::send__you_are_contributing => "You are contributing:",
|
||||
Self::share_words__words_in_order => " words in order.",
|
||||
@ -2732,6 +2733,7 @@ impl TranslatedString {
|
||||
Self::instructions__swipe_down => "Swipe down",
|
||||
#[cfg(feature = "universal_fw")]
|
||||
Self::fido__title_credential_details => "Credential details",
|
||||
Self::label_with_colon_template => "{0}:",
|
||||
}
|
||||
}
|
||||
|
||||
@ -4096,6 +4098,7 @@ impl TranslatedString {
|
||||
Qstr::MP_QSTR_instructions__swipe_down => Some(Self::instructions__swipe_down),
|
||||
#[cfg(feature = "universal_fw")]
|
||||
Qstr::MP_QSTR_fido__title_credential_details => Some(Self::fido__title_credential_details),
|
||||
Qstr::MP_QSTR_label_with_colon_template => Some(Self::label_with_colon_template),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
@ -144,7 +144,6 @@ class TR:
|
||||
cardano__collateral_input_index: str = "Collateral input index:"
|
||||
cardano__collateral_output_contains_tokens: str = "The collateral return output contains tokens."
|
||||
cardano__collateral_return: str = "Collateral return"
|
||||
cardano__confirm: str = "Confirm:"
|
||||
cardano__confirm_signing_stake_pool: str = "Confirm signing the stake pool registration as an owner."
|
||||
cardano__confirm_transaction: str = "Confirm transaction"
|
||||
cardano__confirming_a_multisig_transaction: str = "Confirming a multisig transaction."
|
||||
@ -399,6 +398,7 @@ class TR:
|
||||
joint__title: str = "Joint transaction"
|
||||
joint__to_the_total_amount: str = "To the total amount:"
|
||||
joint__you_are_contributing: str = "You are contributing:"
|
||||
label_with_colon_template: str = "{0}:"
|
||||
language__change_to_template: str = "Change language to {0}?"
|
||||
language__changed: str = "Language changed successfully"
|
||||
language__progress: str = "Changing language"
|
||||
@ -749,7 +749,6 @@ class TR:
|
||||
send__title_sending_to: str = "Sending to"
|
||||
send__to_the_total_amount: str = "To the total amount:"
|
||||
send__total_amount: str = "Total amount"
|
||||
send__total_amount_colon: str = "Total amount:"
|
||||
send__transaction_id: str = "Transaction ID:"
|
||||
send__transaction_signed: str = "Transaction signed"
|
||||
send__you_are_contributing: str = "You are contributing:"
|
||||
|
@ -564,7 +564,10 @@ async def confirm_certificate(
|
||||
assert certificate.type != CardanoCertificateType.STAKE_POOL_REGISTRATION
|
||||
|
||||
props: list[PropertyType] = [
|
||||
(TR.cardano__confirm, CERTIFICATE_TYPE_NAMES[certificate.type]),
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.words__confirm),
|
||||
CERTIFICATE_TYPE_NAMES[certificate.type],
|
||||
),
|
||||
_format_stake_credential(
|
||||
certificate.path, certificate.script_hash, certificate.key_hash
|
||||
),
|
||||
|
@ -56,7 +56,10 @@ async def confirm_action_buyram(msg: EosActionBuyRam) -> None:
|
||||
(
|
||||
(TR.eos__payer, eos_name_to_string(msg.payer)),
|
||||
(TR.eos__receiver, eos_name_to_string(msg.receiver)),
|
||||
(f"{TR.words__amount}:", eos_asset_to_string(msg.quantity)),
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.words__amount),
|
||||
eos_asset_to_string(msg.quantity),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
@ -164,7 +167,10 @@ async def confirm_action_transfer(msg: EosActionTransfer, account: str) -> None:
|
||||
props = [
|
||||
(TR.eos__from, eos_name_to_string(msg.sender)),
|
||||
(TR.eos__to, eos_name_to_string(msg.receiver)),
|
||||
(f"{TR.words__amount}:", eos_asset_to_string(msg.quantity)),
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.words__amount),
|
||||
eos_asset_to_string(msg.quantity),
|
||||
),
|
||||
(TR.eos__contract, account),
|
||||
]
|
||||
if msg.memo is not None:
|
||||
@ -178,7 +184,10 @@ async def confirm_action_transfer(msg: EosActionTransfer, account: str) -> None:
|
||||
|
||||
async def confirm_action_updateauth(msg: EosActionUpdateAuth) -> None:
|
||||
props: list[PropertyType] = [
|
||||
(f"{TR.words__account}:", eos_name_to_string(msg.account)),
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.words__account),
|
||||
eos_name_to_string(msg.account),
|
||||
),
|
||||
(TR.eos__permission, eos_name_to_string(msg.permission)),
|
||||
(TR.eos__parent, eos_name_to_string(msg.parent)),
|
||||
]
|
||||
@ -195,7 +204,10 @@ async def confirm_action_deleteauth(msg: EosActionDeleteAuth) -> None:
|
||||
"confirm_deleteauth",
|
||||
TR.eos__delete_auth,
|
||||
(
|
||||
(f"{TR.words__account}:", eos_name_to_string(msg.account)),
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.words__account),
|
||||
eos_name_to_string(msg.account),
|
||||
),
|
||||
(TR.eos__permission, eos_name_to_string(msg.permission)),
|
||||
),
|
||||
)
|
||||
@ -206,7 +218,10 @@ async def confirm_action_linkauth(msg: EosActionLinkAuth) -> None:
|
||||
"confirm_linkauth",
|
||||
TR.eos__link_auth,
|
||||
(
|
||||
(f"{TR.words__account}:", eos_name_to_string(msg.account)),
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.words__account),
|
||||
eos_name_to_string(msg.account),
|
||||
),
|
||||
(TR.eos__code, eos_name_to_string(msg.code)),
|
||||
(TR.eos__type, eos_name_to_string(msg.type)),
|
||||
(TR.eos__requirement, eos_name_to_string(msg.requirement)),
|
||||
@ -219,7 +234,10 @@ async def confirm_action_unlinkauth(msg: EosActionUnlinkAuth) -> None:
|
||||
"confirm_unlinkauth",
|
||||
TR.eos__unlink_auth,
|
||||
(
|
||||
(f"{TR.words__account}:", eos_name_to_string(msg.account)),
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.words__account),
|
||||
eos_name_to_string(msg.account),
|
||||
),
|
||||
(TR.eos__code, eos_name_to_string(msg.code)),
|
||||
(TR.eos__type, eos_name_to_string(msg.type)),
|
||||
),
|
||||
@ -273,8 +291,8 @@ def authorization_fields(auth: EosAuthorization) -> list[PropertyType]:
|
||||
_key = public_key_to_wif(bytes(key.key))
|
||||
_weight = str(key.weight)
|
||||
|
||||
header = "Key #" + str(i) + ":"
|
||||
w_header = "Key #" + str(i) + " Weight:"
|
||||
header = TR.label_with_colon_template.format(f"Key #{i}")
|
||||
w_header = TR.label_with_colon_template.format(f"Key #{i} Weight")
|
||||
|
||||
append((header, _key))
|
||||
append((w_header, _weight))
|
||||
@ -285,9 +303,9 @@ def authorization_fields(auth: EosAuthorization) -> list[PropertyType]:
|
||||
|
||||
i = str(i)
|
||||
# TODO: handle translation
|
||||
a_header = "Account #" + i + ":"
|
||||
p_header = "Acc Permission #" + i + ":"
|
||||
w_header = "Account #" + i + " weight:"
|
||||
a_header = TR.label_with_colon_template.format(f"Account #{i}")
|
||||
p_header = TR.label_with_colon_template.format(f"Acc Permission #{i}")
|
||||
w_header = TR.label_with_colon_template.format(f"Account #{i} weight")
|
||||
|
||||
append((a_header, _account))
|
||||
append((p_header, _permission))
|
||||
@ -298,7 +316,7 @@ def authorization_fields(auth: EosAuthorization) -> list[PropertyType]:
|
||||
_weight = str(wait.weight)
|
||||
|
||||
header = "Delay #" + str(i)
|
||||
w_header = header + " weight:"
|
||||
w_header = TR.label_with_colon_template.format(header + " weight")
|
||||
append((header, _wait + " sec"))
|
||||
append((w_header, _weight))
|
||||
|
||||
|
@ -36,8 +36,14 @@ def _format_path(path: list[int]) -> str:
|
||||
def _get_address_reference_props(address: AddressReference, display_name: str):
|
||||
return (
|
||||
(TR.solana__is_provided_via_lookup_table_template.format(display_name), ""),
|
||||
(f"{TR.solana__lookup_table_address}:", base58.encode(address[0])),
|
||||
(f"{TR.solana__account_index}:", f"{address[1]}"),
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.solana__lookup_table_address),
|
||||
base58.encode(address[0]),
|
||||
),
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.solana__account_index),
|
||||
f"{address[1]}",
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@ -143,7 +149,9 @@ async def confirm_instruction(
|
||||
|
||||
signers.append(
|
||||
(
|
||||
f"{TR.words__signer} {i}{path_str}:",
|
||||
TR.label_with_colon_template.format(
|
||||
f"{TR.words__signer} {i}{path_str}"
|
||||
),
|
||||
base58.encode(multisig_signer[0]),
|
||||
)
|
||||
)
|
||||
@ -194,7 +202,12 @@ async def confirm_unsupported_instruction_details(
|
||||
await confirm_properties(
|
||||
"instruction_data",
|
||||
title,
|
||||
((f"{TR.solana__instruction_data}:", bytes(instruction.instruction_data)),),
|
||||
(
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.solana__instruction_data),
|
||||
bytes(instruction.instruction_data),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
accounts = []
|
||||
@ -209,7 +222,9 @@ async def confirm_unsupported_instruction_details(
|
||||
|
||||
accounts.append(
|
||||
(
|
||||
f"{TR.words__account} {i}{path_str} {address_type}:",
|
||||
TR.label_with_colon_template.format(
|
||||
f"{TR.words__account} {i}{path_str} {address_type}"
|
||||
),
|
||||
base58.encode(account_public_key),
|
||||
)
|
||||
)
|
||||
@ -302,7 +317,14 @@ async def confirm_token_transfer(
|
||||
br_code=ButtonRequestType.ConfirmOutput,
|
||||
verb=TR.buttons__continue,
|
||||
info_items=(
|
||||
((f"{TR.solana__associated_token_account}:", base58.encode(token_account)),)
|
||||
(
|
||||
(
|
||||
TR.label_with_colon_template.format(
|
||||
TR.solana__associated_token_account
|
||||
),
|
||||
base58.encode(token_account),
|
||||
),
|
||||
)
|
||||
if token_account != destination_account
|
||||
else None
|
||||
),
|
||||
@ -338,10 +360,16 @@ async def confirm_custom_transaction(
|
||||
await confirm_solana_tx(
|
||||
amount=f"{format_amount(amount, decimals)} {unit}",
|
||||
fee=f"{format_amount(fee, 9)} SOL",
|
||||
fee_title=f"{TR.solana__expected_fee}:",
|
||||
fee_title=TR.label_with_colon_template.format(TR.solana__expected_fee),
|
||||
items=(
|
||||
(f"{TR.words__account}:", _format_path(signer_path)),
|
||||
(f"{TR.words__blockhash}:", base58.encode(blockhash)),
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.words__account),
|
||||
_format_path(signer_path),
|
||||
),
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.words__blockhash),
|
||||
base58.encode(blockhash),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
@ -353,9 +381,15 @@ async def confirm_transaction(
|
||||
amount="",
|
||||
amount_title="",
|
||||
fee=f"{format_amount(fee, 9)} SOL",
|
||||
fee_title=f"{TR.solana__expected_fee}:",
|
||||
fee_title=TR.label_with_colon_template.format(TR.solana__expected_fee),
|
||||
items=(
|
||||
(f"{TR.words__account}:", _format_path(signer_path)),
|
||||
(f"{TR.words__blockhash}:", base58.encode(blockhash)),
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.words__account),
|
||||
_format_path(signer_path),
|
||||
),
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.words__blockhash),
|
||||
base58.encode(blockhash),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
@ -283,7 +283,7 @@ async def confirm_set_options_op(op: StellarSetOptionsOp) -> None:
|
||||
title = TR.stellar__remove_signer
|
||||
data: str | bytes = ""
|
||||
if signer_type == StellarSignerType.ACCOUNT:
|
||||
description = f"{TR.words__account}:"
|
||||
description = TR.label_with_colon_template.format(TR.words__account)
|
||||
data = helpers.address_from_public_key(signer_key)
|
||||
elif signer_type == StellarSignerType.PRE_AUTH:
|
||||
description = TR.stellar__preauth_transaction
|
||||
|
@ -22,7 +22,7 @@ async def require_confirm_fee(value: int, fee: int) -> None:
|
||||
await confirm_total(
|
||||
format_tezos_amount(value),
|
||||
format_tezos_amount(fee),
|
||||
total_label=f"{TR.words__amount}:",
|
||||
total_label=TR.label_with_colon_template.format(TR.words__amount),
|
||||
)
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ async def require_confirm_origination(address: str) -> None:
|
||||
await confirm_address(
|
||||
TR.tezos__confirm_origination,
|
||||
address,
|
||||
f"{TR.words__address}:",
|
||||
TR.label_with_colon_template.format(TR.words__address),
|
||||
"confirm_origination",
|
||||
BR_SIGN_TX,
|
||||
)
|
||||
@ -42,7 +42,10 @@ async def require_confirm_origination_fee(balance: int, fee: int) -> None:
|
||||
TR.tezos__confirm_origination,
|
||||
(
|
||||
(TR.tezos__balance, format_tezos_amount(balance)),
|
||||
(f"{TR.words__fee}:", format_tezos_amount(fee)),
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.words__fee),
|
||||
format_tezos_amount(fee),
|
||||
),
|
||||
),
|
||||
hold=True,
|
||||
)
|
||||
@ -62,7 +65,7 @@ async def require_confirm_set_delegate(fee: int) -> None:
|
||||
await confirm_metadata(
|
||||
"confirm_delegation_final",
|
||||
TR.tezos__confirm_delegation,
|
||||
f"{TR.words__fee}:" + "\n{}",
|
||||
TR.label_with_colon_template.format(TR.words__fee) + "\n{}",
|
||||
format_tezos_amount(fee),
|
||||
BR_SIGN_TX,
|
||||
hold=True,
|
||||
@ -74,8 +77,11 @@ async def require_confirm_register_delegate(address: str, fee: int) -> None:
|
||||
"confirm_register_delegate",
|
||||
TR.tezos__register_delegate,
|
||||
(
|
||||
(f"{TR.words__fee}:", format_tezos_amount(fee)),
|
||||
(f"{TR.words__address}:", address),
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.words__fee),
|
||||
format_tezos_amount(fee),
|
||||
),
|
||||
(TR.label_with_colon_template.format(TR.words__address), address),
|
||||
),
|
||||
hold=True,
|
||||
br_code=BR_SIGN_TX,
|
||||
@ -97,7 +103,7 @@ async def require_confirm_ballot(proposal: str, ballot: str) -> None:
|
||||
TR.tezos__submit_ballot,
|
||||
(
|
||||
(TR.tezos__ballot, ballot),
|
||||
(f"{TR.tezos__proposal}:", proposal),
|
||||
(TR.label_with_colon_template.format(TR.tezos__proposal), proposal),
|
||||
),
|
||||
hold=True,
|
||||
br_code=BR_SIGN_TX,
|
||||
@ -131,7 +137,7 @@ async def require_confirm_manager_remove_delegate(fee: int) -> None:
|
||||
await confirm_metadata(
|
||||
"confirm_undelegation_final",
|
||||
TR.tezos__remove_delegation,
|
||||
f"{TR.words__fee}:" + "\n{}",
|
||||
TR.label_with_colon_template.format(TR.words__fee) + "\n{}",
|
||||
format_tezos_amount(fee),
|
||||
BR_SIGN_TX,
|
||||
hold=True,
|
||||
|
@ -1116,7 +1116,9 @@ if not utils.BITCOIN_ONLY:
|
||||
br_code: ButtonRequestType = ButtonRequestType.SignTx,
|
||||
) -> Awaitable[None]:
|
||||
amount_title = (
|
||||
amount_title if amount_title is not None else f"{TR.words__amount}:"
|
||||
amount_title
|
||||
if amount_title is not None
|
||||
else TR.label_with_colon_template.format(TR.words__amount)
|
||||
) # def_arg
|
||||
fee_title = fee_title or TR.words__fee # def_arg
|
||||
return _confirm_summary(
|
||||
|
@ -1027,7 +1027,9 @@ def confirm_amount(
|
||||
br_name: str = "confirm_amount",
|
||||
br_code: ButtonRequestType = BR_CODE_OTHER,
|
||||
) -> Awaitable[None]:
|
||||
description = description or f"{TR.words__amount}:" # def_arg
|
||||
description = description or TR.label_with_colon_template.format(
|
||||
TR.words__amount
|
||||
) # def_arg
|
||||
return confirm_blob(
|
||||
br_name,
|
||||
title,
|
||||
@ -1163,7 +1165,9 @@ def confirm_total(
|
||||
br_name: str = "confirm_total",
|
||||
br_code: ButtonRequestType = ButtonRequestType.SignTx,
|
||||
) -> Awaitable[None]:
|
||||
total_label = total_label or TR.send__total_amount_colon # def_arg
|
||||
total_label = total_label or TR.label_with_colon_template.format(
|
||||
TR.send__total_amount
|
||||
) # def_arg
|
||||
fee_label = fee_label or TR.send__including_fee # def_arg
|
||||
return raise_if_not_confirmed(
|
||||
interact(
|
||||
@ -1216,7 +1220,7 @@ if not utils.BITCOIN_ONLY:
|
||||
amount_title = verb
|
||||
amount_value = ""
|
||||
else:
|
||||
amount_title = f"{TR.words__amount}:"
|
||||
amount_title = TR.label_with_colon_template.format(TR.words__amount)
|
||||
amount_value = total_amount
|
||||
await raise_if_not_confirmed(
|
||||
interact(
|
||||
@ -1224,9 +1228,14 @@ if not utils.BITCOIN_ONLY:
|
||||
trezorui2.altcoin_tx_summary(
|
||||
amount_title=amount_title,
|
||||
amount_value=amount_value,
|
||||
fee_title=f"{TR.send__maximum_fee}:",
|
||||
fee_title=TR.label_with_colon_template.format(
|
||||
TR.send__maximum_fee
|
||||
),
|
||||
fee_value=maximum_fee,
|
||||
items=[(f"{k}:", v) for (k, v) in info_items],
|
||||
items=[
|
||||
(TR.label_with_colon_template.format(k), v)
|
||||
for (k, v) in info_items
|
||||
],
|
||||
cancel_cross=True,
|
||||
)
|
||||
),
|
||||
@ -1245,7 +1254,9 @@ if not utils.BITCOIN_ONLY:
|
||||
br_code: ButtonRequestType = ButtonRequestType.SignTx,
|
||||
) -> Awaitable[None]:
|
||||
amount_title = (
|
||||
amount_title if amount_title is not None else f"{TR.words__amount}:"
|
||||
amount_title
|
||||
if amount_title is not None
|
||||
else TR.label_with_colon_template.format(TR.words__amount)
|
||||
) # def_arg
|
||||
fee_title = fee_title or TR.words__fee # def_arg
|
||||
return raise_if_not_confirmed(
|
||||
@ -1276,11 +1287,14 @@ if not utils.BITCOIN_ONLY:
|
||||
) -> None:
|
||||
summary_layout = RustLayout(
|
||||
trezorui2.altcoin_tx_summary(
|
||||
amount_title=f"{TR.words__amount}:",
|
||||
amount_title=TR.label_with_colon_template.format(TR.words__amount),
|
||||
amount_value=total_amount,
|
||||
fee_title=f"{TR.send__maximum_fee}:",
|
||||
fee_title=TR.label_with_colon_template.format(TR.send__maximum_fee),
|
||||
fee_value=maximum_fee,
|
||||
items=[(f"{k}:", v) for (k, v) in fee_info_items],
|
||||
items=[
|
||||
(TR.label_with_colon_template.format(k), v)
|
||||
for (k, v) in fee_info_items
|
||||
],
|
||||
)
|
||||
)
|
||||
|
||||
@ -1363,7 +1377,7 @@ async def confirm_modify_output(
|
||||
data=address,
|
||||
verb=TR.buttons__continue,
|
||||
verb_cancel=None,
|
||||
description=f"{TR.words__address}:",
|
||||
description=TR.label_with_colon_template.format(TR.words__address),
|
||||
extra=None,
|
||||
)
|
||||
)
|
||||
|
@ -942,7 +942,9 @@ def confirm_amount(
|
||||
br_name: str = "confirm_amount",
|
||||
br_code: ButtonRequestType = BR_CODE_OTHER,
|
||||
) -> Awaitable[None]:
|
||||
description = description or f"{TR.words__amount}:" # def_arg
|
||||
description = description or TR.label_with_colon_template.format(
|
||||
TR.words__amount
|
||||
) # def_arg
|
||||
return confirm_value(
|
||||
title,
|
||||
amount,
|
||||
@ -1041,7 +1043,9 @@ def confirm_total(
|
||||
br_code: ButtonRequestType = ButtonRequestType.SignTx,
|
||||
) -> Awaitable[None]:
|
||||
title = title or TR.words__title_summary # def_arg
|
||||
total_label = total_label or TR.send__total_amount_colon # def_arg
|
||||
total_label = total_label or TR.label_with_colon_template.format(
|
||||
TR.send__total_amount
|
||||
) # def_arg
|
||||
fee_label = fee_label or TR.send__including_fee # def_arg
|
||||
|
||||
items = [
|
||||
@ -1052,7 +1056,12 @@ def confirm_total(
|
||||
if source_account:
|
||||
info_items.append((TR.confirm_total__sending_from_account, source_account))
|
||||
if fee_rate_amount:
|
||||
info_items.append((TR.confirm_total__fee_rate_colon, fee_rate_amount))
|
||||
info_items.append(
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.confirm_total__fee_rate),
|
||||
fee_rate_amount,
|
||||
)
|
||||
)
|
||||
|
||||
return _confirm_summary(
|
||||
items,
|
||||
@ -1107,8 +1116,14 @@ if not utils.BITCOIN_ONLY:
|
||||
trezorui2.confirm_total(
|
||||
title=TR.words__title_summary,
|
||||
items=[
|
||||
(f"{TR.words__amount}:", total_amount),
|
||||
(f"{TR.send__maximum_fee}:", maximum_fee),
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.words__amount),
|
||||
total_amount,
|
||||
),
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.send__maximum_fee),
|
||||
maximum_fee,
|
||||
),
|
||||
],
|
||||
info_button=True,
|
||||
cancel_arrow=True,
|
||||
@ -1117,7 +1132,10 @@ if not utils.BITCOIN_ONLY:
|
||||
info_layout = RustLayout(
|
||||
trezorui2.show_info_with_cancel(
|
||||
title=TR.confirm_total__title_fee,
|
||||
items=[(f"{k}:", v) for (k, v) in fee_info_items],
|
||||
items=[
|
||||
(TR.label_with_colon_template.format(k), v)
|
||||
for (k, v) in fee_info_items
|
||||
],
|
||||
)
|
||||
)
|
||||
|
||||
@ -1169,17 +1187,27 @@ if not utils.BITCOIN_ONLY:
|
||||
|
||||
# confirmation
|
||||
if verb == TR.ethereum__staking_claim:
|
||||
items = ((f"{TR.send__maximum_fee}:", maximum_fee),)
|
||||
items = (
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.send__maximum_fee),
|
||||
maximum_fee,
|
||||
),
|
||||
)
|
||||
else:
|
||||
items = (
|
||||
(f"{TR.words__amount}:", total_amount),
|
||||
(f"{TR.send__maximum_fee}:", maximum_fee),
|
||||
(TR.label_with_colon_template.format(TR.words__amount), total_amount),
|
||||
(
|
||||
TR.label_with_colon_template.format(TR.send__maximum_fee),
|
||||
maximum_fee,
|
||||
),
|
||||
)
|
||||
await _confirm_summary(
|
||||
items, # items
|
||||
title=title,
|
||||
info_title=TR.confirm_total__title_fee,
|
||||
info_items=[(f"{k}:", v) for (k, v) in info_items],
|
||||
info_items=[
|
||||
(TR.label_with_colon_template.format(k), v) for (k, v) in info_items
|
||||
],
|
||||
br_name=br_name,
|
||||
br_code=br_code,
|
||||
)
|
||||
@ -1194,7 +1222,9 @@ if not utils.BITCOIN_ONLY:
|
||||
br_code: ButtonRequestType = ButtonRequestType.SignTx,
|
||||
) -> Awaitable[None]:
|
||||
amount_title = (
|
||||
amount_title if amount_title is not None else f"{TR.words__amount}:"
|
||||
amount_title
|
||||
if amount_title is not None
|
||||
else TR.label_with_colon_template.format(TR.words__amount)
|
||||
) # def_arg
|
||||
fee_title = fee_title or TR.words__fee # def_arg
|
||||
return _confirm_summary(
|
||||
@ -1268,7 +1298,7 @@ async def confirm_modify_output(
|
||||
data=address,
|
||||
verb=TR.buttons__continue,
|
||||
verb_cancel=None,
|
||||
description=f"{TR.words__address}:",
|
||||
description=TR.label_with_colon_template.format(TR.words__address),
|
||||
extra=None,
|
||||
)
|
||||
)
|
||||
@ -1412,9 +1442,16 @@ async def confirm_signverify(
|
||||
|
||||
items: list[tuple[str, str]] = []
|
||||
if account is not None:
|
||||
items.append((f"{TR.words__account}:", account))
|
||||
items.append((TR.label_with_colon_template.format(TR.words__account), account))
|
||||
if path is not None:
|
||||
items.append((TR.address_details__derivation_path_colon, path))
|
||||
items.append(
|
||||
(
|
||||
TR.label_with_colon_template.format(
|
||||
TR.address_details__derivation_path
|
||||
),
|
||||
path,
|
||||
)
|
||||
)
|
||||
items.append(
|
||||
(
|
||||
TR.sign_message__message_size,
|
||||
|
@ -176,7 +176,6 @@
|
||||
"cardano__collateral_input_index": "Index vstupu zástavy:",
|
||||
"cardano__collateral_output_contains_tokens": "Výstup vrácení zástavy obsahuje tokeny.",
|
||||
"cardano__collateral_return": "Vrácení zástavy",
|
||||
"cardano__confirm": "Potvrdit:",
|
||||
"cardano__confirm_signing_stake_pool": "Potvrďte podepsání registrace stake poolu coby vlastník.",
|
||||
"cardano__confirm_transaction": "Potvrďte transakci",
|
||||
"cardano__confirming_a_multisig_transaction": "Potvrzení transakce multisig.",
|
||||
@ -424,6 +423,7 @@
|
||||
"joint__title": "Společná transakce",
|
||||
"joint__to_the_total_amount": "Do celkové částky:",
|
||||
"joint__you_are_contributing": "Přispíváte:",
|
||||
"label_with_colon_template": "{0}:",
|
||||
"language__change_to_template": "Změnit jazyk na {0}?",
|
||||
"language__changed": "Jazyk byl změněn",
|
||||
"language__progress": "Změna jazyka",
|
||||
@ -771,7 +771,6 @@
|
||||
"send__title_sending_to": "Odesílání",
|
||||
"send__to_the_total_amount": "Do celkové částky:",
|
||||
"send__total_amount": "Celková částka",
|
||||
"send__total_amount_colon": "Celková částka:",
|
||||
"send__transaction_id": "ID transakce:",
|
||||
"send__transaction_signed": "Transakce podepsána",
|
||||
"send__you_are_contributing": "Přispíváte:",
|
||||
|
@ -176,7 +176,6 @@
|
||||
"cardano__collateral_input_index": "Sicherheiten-Eingabeindex:",
|
||||
"cardano__collateral_output_contains_tokens": "Die Rückgabe von Sicherheiten beinhaltet Token.",
|
||||
"cardano__collateral_return": "Rückgabe von Sicherheiten",
|
||||
"cardano__confirm": "Bestätigen:",
|
||||
"cardano__confirm_signing_stake_pool": "Bestätige, dass du die Registrierung des Pools als Eigentümer signiert hast.",
|
||||
"cardano__confirm_transaction": "Transakt. bestät.",
|
||||
"cardano__confirming_a_multisig_transaction": "Multisig-Transakt. bestät.",
|
||||
@ -424,6 +423,7 @@
|
||||
"joint__title": "Gemeins. transakt.",
|
||||
"joint__to_the_total_amount": "Gesamtbetrag:",
|
||||
"joint__you_are_contributing": "Dein Anteil:",
|
||||
"label_with_colon_template": "{0}:",
|
||||
"language__change_to_template": "Sprache in {0} ändern?",
|
||||
"language__changed": "Die Sprache änderte sich erfolgreich",
|
||||
"language__progress": "Sprache ändern",
|
||||
@ -771,7 +771,6 @@
|
||||
"send__title_sending_to": "Senden an",
|
||||
"send__to_the_total_amount": "Gesamtbetrag:",
|
||||
"send__total_amount": "Gesamtbetrag",
|
||||
"send__total_amount_colon": "Gesamtbetrag:",
|
||||
"send__transaction_id": "Transaktions-ID:",
|
||||
"send__transaction_signed": "Transaktion signiert",
|
||||
"send__you_are_contributing": "Dein Anteil:",
|
||||
|
@ -146,7 +146,6 @@
|
||||
"cardano__collateral_input_index": "Collateral input index:",
|
||||
"cardano__collateral_output_contains_tokens": "The collateral return output contains tokens.",
|
||||
"cardano__collateral_return": "Collateral return",
|
||||
"cardano__confirm": "Confirm:",
|
||||
"cardano__confirm_signing_stake_pool": "Confirm signing the stake pool registration as an owner.",
|
||||
"cardano__confirm_transaction": "Confirm transaction",
|
||||
"cardano__confirming_a_multisig_transaction": "Confirming a multisig transaction.",
|
||||
@ -401,6 +400,7 @@
|
||||
"joint__title": "Joint transaction",
|
||||
"joint__to_the_total_amount": "To the total amount:",
|
||||
"joint__you_are_contributing": "You are contributing:",
|
||||
"label_with_colon_template": "{0}:",
|
||||
"language__change_to_template": "Change language to {0}?",
|
||||
"language__changed": "Language changed successfully",
|
||||
"language__progress": "Changing language",
|
||||
@ -751,7 +751,6 @@
|
||||
"send__title_sending_to": "Sending to",
|
||||
"send__to_the_total_amount": "To the total amount:",
|
||||
"send__total_amount": "Total amount",
|
||||
"send__total_amount_colon": "Total amount:",
|
||||
"send__transaction_id": "Transaction ID:",
|
||||
"send__transaction_signed": "Transaction signed",
|
||||
"send__you_are_contributing": "You are contributing:",
|
||||
|
@ -176,7 +176,6 @@
|
||||
"cardano__collateral_input_index": "Índice de entrada de garantía:",
|
||||
"cardano__collateral_output_contains_tokens": "La salida de rentabilidad de la garantía contiene tokens.",
|
||||
"cardano__collateral_return": "Rentabilidad de la garantía",
|
||||
"cardano__confirm": "Confirmar:",
|
||||
"cardano__confirm_signing_stake_pool": "Confirma la firma del registro del stake pool como propietario.",
|
||||
"cardano__confirm_transaction": "Confirmar la transacción",
|
||||
"cardano__confirming_a_multisig_transaction": "Confirmar una transacción multifirma.",
|
||||
@ -424,6 +423,7 @@
|
||||
"joint__title": "Transacc. conjunta",
|
||||
"joint__to_the_total_amount": "Al importe total:",
|
||||
"joint__you_are_contributing": "Estás aportando:",
|
||||
"label_with_colon_template": "{0}:",
|
||||
"language__change_to_template": "Cambiar el idioma a {0}?",
|
||||
"language__changed": "El lenguaje cambió con éxito",
|
||||
"language__progress": "Lenguaje cambiante",
|
||||
@ -771,7 +771,6 @@
|
||||
"send__title_sending_to": "Envío a",
|
||||
"send__to_the_total_amount": "Al importe total:",
|
||||
"send__total_amount": "Importe total",
|
||||
"send__total_amount_colon": "Importe total:",
|
||||
"send__transaction_id": "ID de la transacción:",
|
||||
"send__transaction_signed": "Transacción firmada",
|
||||
"send__you_are_contributing": "Estás aportando:",
|
||||
|
@ -176,7 +176,6 @@
|
||||
"cardano__collateral_input_index": "Index d'entrée de garantie :",
|
||||
"cardano__collateral_output_contains_tokens": "La sortie du retour de la garantie contient des jetons.",
|
||||
"cardano__collateral_return": "Retour de la garantie",
|
||||
"cardano__confirm": "Conf. :",
|
||||
"cardano__confirm_signing_stake_pool": "Confirmez la signature de l'enregistrement du pool de staking en tant que propriétaire.",
|
||||
"cardano__confirm_transaction": "Conf. la transaction",
|
||||
"cardano__confirming_a_multisig_transaction": "Confirmation d'une transaction multisignatures.",
|
||||
@ -276,7 +275,7 @@
|
||||
"coinjoin__title_progress": "Coinjoin en cours",
|
||||
"coinjoin__waiting_for_others": "En attente des autres",
|
||||
"confirm_total__fee_rate": "Taux des frais",
|
||||
"confirm_total__fee_rate_colon": "Taux des frais :",
|
||||
"confirm_total__fee_rate_colon": "Taux des frais :",
|
||||
"confirm_total__sending_from_account": "Compte d'envoi :",
|
||||
"confirm_total__title_fee": "Infos sur les frais",
|
||||
"confirm_total__title_sending_from": "Envoi depuis",
|
||||
@ -424,6 +423,7 @@
|
||||
"joint__title": "Trans. commune",
|
||||
"joint__to_the_total_amount": "Au montant total :",
|
||||
"joint__you_are_contributing": "Votre contribution :",
|
||||
"label_with_colon_template": "{0} :",
|
||||
"language__change_to_template": "Changer la langue en {0}?",
|
||||
"language__changed": "La langue a changé avec succès",
|
||||
"language__progress": "Langage changeant",
|
||||
@ -771,7 +771,6 @@
|
||||
"send__title_sending_to": "Envoi à",
|
||||
"send__to_the_total_amount": "Au montant total :",
|
||||
"send__total_amount": "Montant total",
|
||||
"send__total_amount_colon": "Montant total :",
|
||||
"send__transaction_id": "ID de transaction :",
|
||||
"send__transaction_signed": "Transaction signée",
|
||||
"send__you_are_contributing": "Votre contribution :",
|
||||
|
@ -964,5 +964,6 @@
|
||||
"962": "fido__title_for_authentication",
|
||||
"963": "fido__title_select_credential",
|
||||
"964": "instructions__swipe_down",
|
||||
"965": "fido__title_credential_details"
|
||||
"965": "fido__title_credential_details",
|
||||
"966": "label_with_colon_template"
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"current": {
|
||||
"merkle_root": "c9955c551a9664f3ce19327604da9fb9d135baaf48c7598abc0da7c2b133bf7f",
|
||||
"datetime": "2024-09-12T12:15:56.095802",
|
||||
"commit": "43b7d717f2791c62f4ed1f4d724a8eb1c42a6398"
|
||||
"merkle_root": "3f6c6b20bf74d00cecf586526ce439cafd544dbd13bb7743dd953688e61c2885",
|
||||
"datetime": "2024-09-16T07:38:52.218918",
|
||||
"commit": "8507335806f6417faf0599373f52398e1caceeb8"
|
||||
},
|
||||
"history": [
|
||||
{
|
||||
|
@ -458,7 +458,7 @@ class InputFlowShowMultisigXPUBs(InputFlowBase):
|
||||
layout = self.debug.swipe_left(wait=True)
|
||||
# address details
|
||||
assert "Multisig 2 of 3" in layout.screen_content()
|
||||
TR.assert_in(layout.screen_content(), "address_details__derivation_path_colon")
|
||||
TR.assert_in(layout.screen_content(), "address_details__derivation_path")
|
||||
|
||||
# Three xpub pages with the same testing logic
|
||||
for xpub_num in range(3):
|
||||
|
Loading…
Reference in New Issue
Block a user