1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-05-07 01:19:04 +00:00

refactor(core): use code to append colon to strings

[no changelog]
This commit is contained in:
Ioan Bizău 2024-08-28 18:34:09 +02:00 committed by Martin Milata
parent 74fb627733
commit 32be89a29a
18 changed files with 65 additions and 190 deletions

View File

@ -311,7 +311,6 @@ static void _librust_qstrs(void) {
MP_QSTR_joint__to_the_total_amount; MP_QSTR_joint__to_the_total_amount;
MP_QSTR_joint__you_are_contributing; MP_QSTR_joint__you_are_contributing;
MP_QSTR_label; MP_QSTR_label;
MP_QSTR_label_with_colon_template;
MP_QSTR_language; MP_QSTR_language;
MP_QSTR_language__change_to_template; MP_QSTR_language__change_to_template;
MP_QSTR_language__changed; MP_QSTR_language__changed;

View File

@ -1369,7 +1369,6 @@ pub enum TranslatedString {
instructions__swipe_down = 964, // "Swipe down" instructions__swipe_down = 964, // "Swipe down"
#[cfg(feature = "universal_fw")] #[cfg(feature = "universal_fw")]
fido__title_credential_details = 965, // "Credential details" fido__title_credential_details = 965, // "Credential details"
label_with_colon_template = 966, // "{0}:"
} }
impl TranslatedString { impl TranslatedString {
@ -2733,7 +2732,6 @@ impl TranslatedString {
Self::instructions__swipe_down => "Swipe down", Self::instructions__swipe_down => "Swipe down",
#[cfg(feature = "universal_fw")] #[cfg(feature = "universal_fw")]
Self::fido__title_credential_details => "Credential details", Self::fido__title_credential_details => "Credential details",
Self::label_with_colon_template => "{0}:",
} }
} }
@ -4098,7 +4096,6 @@ impl TranslatedString {
Qstr::MP_QSTR_instructions__swipe_down => Some(Self::instructions__swipe_down), Qstr::MP_QSTR_instructions__swipe_down => Some(Self::instructions__swipe_down),
#[cfg(feature = "universal_fw")] #[cfg(feature = "universal_fw")]
Qstr::MP_QSTR_fido__title_credential_details => Some(Self::fido__title_credential_details), 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, _ => None,
} }
} }

View File

@ -398,7 +398,6 @@ class TR:
joint__title: str = "Joint transaction" joint__title: str = "Joint transaction"
joint__to_the_total_amount: str = "To the total amount:" joint__to_the_total_amount: str = "To the total amount:"
joint__you_are_contributing: str = "You are contributing:" joint__you_are_contributing: str = "You are contributing:"
label_with_colon_template: str = "{0}:"
language__change_to_template: str = "Change language to {0}?" language__change_to_template: str = "Change language to {0}?"
language__changed: str = "Language changed successfully" language__changed: str = "Language changed successfully"
language__progress: str = "Changing language" language__progress: str = "Changing language"

View File

@ -564,10 +564,7 @@ async def confirm_certificate(
assert certificate.type != CardanoCertificateType.STAKE_POOL_REGISTRATION assert certificate.type != CardanoCertificateType.STAKE_POOL_REGISTRATION
props: list[PropertyType] = [ props: list[PropertyType] = [
( (f"{TR.words__confirm}:", CERTIFICATE_TYPE_NAMES[certificate.type]),
TR.label_with_colon_template.format(TR.words__confirm),
CERTIFICATE_TYPE_NAMES[certificate.type],
),
_format_stake_credential( _format_stake_credential(
certificate.path, certificate.script_hash, certificate.key_hash certificate.path, certificate.script_hash, certificate.key_hash
), ),

View File

@ -56,10 +56,7 @@ async def confirm_action_buyram(msg: EosActionBuyRam) -> None:
( (
(TR.eos__payer, eos_name_to_string(msg.payer)), (TR.eos__payer, eos_name_to_string(msg.payer)),
(TR.eos__receiver, eos_name_to_string(msg.receiver)), (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),
),
), ),
) )
@ -167,10 +164,7 @@ async def confirm_action_transfer(msg: EosActionTransfer, account: str) -> None:
props = [ props = [
(TR.eos__from, eos_name_to_string(msg.sender)), (TR.eos__from, eos_name_to_string(msg.sender)),
(TR.eos__to, eos_name_to_string(msg.receiver)), (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), (TR.eos__contract, account),
] ]
if msg.memo is not None: if msg.memo is not None:
@ -184,10 +178,7 @@ async def confirm_action_transfer(msg: EosActionTransfer, account: str) -> None:
async def confirm_action_updateauth(msg: EosActionUpdateAuth) -> None: async def confirm_action_updateauth(msg: EosActionUpdateAuth) -> None:
props: list[PropertyType] = [ 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__permission, eos_name_to_string(msg.permission)),
(TR.eos__parent, eos_name_to_string(msg.parent)), (TR.eos__parent, eos_name_to_string(msg.parent)),
] ]
@ -204,10 +195,7 @@ async def confirm_action_deleteauth(msg: EosActionDeleteAuth) -> None:
"confirm_deleteauth", "confirm_deleteauth",
TR.eos__delete_auth, 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)), (TR.eos__permission, eos_name_to_string(msg.permission)),
), ),
) )
@ -218,10 +206,7 @@ async def confirm_action_linkauth(msg: EosActionLinkAuth) -> None:
"confirm_linkauth", "confirm_linkauth",
TR.eos__link_auth, 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__code, eos_name_to_string(msg.code)),
(TR.eos__type, eos_name_to_string(msg.type)), (TR.eos__type, eos_name_to_string(msg.type)),
(TR.eos__requirement, eos_name_to_string(msg.requirement)), (TR.eos__requirement, eos_name_to_string(msg.requirement)),
@ -234,10 +219,7 @@ async def confirm_action_unlinkauth(msg: EosActionUnlinkAuth) -> None:
"confirm_unlinkauth", "confirm_unlinkauth",
TR.eos__unlink_auth, 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__code, eos_name_to_string(msg.code)),
(TR.eos__type, eos_name_to_string(msg.type)), (TR.eos__type, eos_name_to_string(msg.type)),
), ),
@ -291,8 +273,8 @@ def authorization_fields(auth: EosAuthorization) -> list[PropertyType]:
_key = public_key_to_wif(bytes(key.key)) _key = public_key_to_wif(bytes(key.key))
_weight = str(key.weight) _weight = str(key.weight)
header = TR.label_with_colon_template.format(f"Key #{i}") header = f"Key #{i}:"
w_header = TR.label_with_colon_template.format(f"Key #{i} Weight") w_header = f"Key #{i} Weight:"
append((header, _key)) append((header, _key))
append((w_header, _weight)) append((w_header, _weight))
@ -303,9 +285,9 @@ def authorization_fields(auth: EosAuthorization) -> list[PropertyType]:
i = str(i) i = str(i)
# TODO: handle translation # TODO: handle translation
a_header = TR.label_with_colon_template.format(f"Account #{i}") a_header = f"Account #{i}:"
p_header = TR.label_with_colon_template.format(f"Acc Permission #{i}") p_header = f"Acc Permission #{i}:"
w_header = TR.label_with_colon_template.format(f"Account #{i} weight") w_header = f"Account #{i} weight:"
append((a_header, _account)) append((a_header, _account))
append((p_header, _permission)) append((p_header, _permission))
@ -315,9 +297,9 @@ def authorization_fields(auth: EosAuthorization) -> list[PropertyType]:
_wait = str(wait.wait_sec) _wait = str(wait.wait_sec)
_weight = str(wait.weight) _weight = str(wait.weight)
header = "Delay #" + str(i) header = f"Delay #{i}"
w_header = TR.label_with_colon_template.format(header + " weight") w_header = f"{header} weight:"
append((header, _wait + " sec")) append((f"{header}:", _wait + " sec"))
append((w_header, _weight)) append((w_header, _weight))
return fields return fields

View File

@ -36,14 +36,8 @@ def _format_path(path: list[int]) -> str:
def _get_address_reference_props(address: AddressReference, display_name: str): def _get_address_reference_props(address: AddressReference, display_name: str):
return ( return (
(TR.solana__is_provided_via_lookup_table_template.format(display_name), ""), (TR.solana__is_provided_via_lookup_table_template.format(display_name), ""),
( (f"{TR.solana__lookup_table_address}:", base58.encode(address[0])),
TR.label_with_colon_template.format(TR.solana__lookup_table_address), (f"{TR.solana__account_index}:", f"{address[1]}"),
base58.encode(address[0]),
),
(
TR.label_with_colon_template.format(TR.solana__account_index),
f"{address[1]}",
),
) )
@ -149,9 +143,7 @@ async def confirm_instruction(
signers.append( signers.append(
( (
TR.label_with_colon_template.format( f"{TR.words__signer} {i}{path_str}:",
f"{TR.words__signer} {i}{path_str}"
),
base58.encode(multisig_signer[0]), base58.encode(multisig_signer[0]),
) )
) )
@ -202,12 +194,7 @@ async def confirm_unsupported_instruction_details(
await confirm_properties( await confirm_properties(
"instruction_data", "instruction_data",
title, 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 = [] accounts = []
@ -222,9 +209,7 @@ async def confirm_unsupported_instruction_details(
accounts.append( accounts.append(
( (
TR.label_with_colon_template.format( f"{TR.words__account} {i}{path_str} {address_type}:",
f"{TR.words__account} {i}{path_str} {address_type}"
),
base58.encode(account_public_key), base58.encode(account_public_key),
) )
) )
@ -317,14 +302,7 @@ async def confirm_token_transfer(
br_code=ButtonRequestType.ConfirmOutput, br_code=ButtonRequestType.ConfirmOutput,
verb=TR.buttons__continue, verb=TR.buttons__continue,
info_items=( 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 if token_account != destination_account
else None else None
), ),
@ -360,16 +338,10 @@ async def confirm_custom_transaction(
await confirm_solana_tx( await confirm_solana_tx(
amount=f"{format_amount(amount, decimals)} {unit}", amount=f"{format_amount(amount, decimals)} {unit}",
fee=f"{format_amount(fee, 9)} SOL", fee=f"{format_amount(fee, 9)} SOL",
fee_title=TR.label_with_colon_template.format(TR.solana__expected_fee), fee_title=f"{TR.solana__expected_fee}:",
items=( items=(
( (f"{TR.words__account}:", _format_path(signer_path)),
TR.label_with_colon_template.format(TR.words__account), (f"{TR.words__blockhash}:", base58.encode(blockhash)),
_format_path(signer_path),
),
(
TR.label_with_colon_template.format(TR.words__blockhash),
base58.encode(blockhash),
),
), ),
) )
@ -381,15 +353,9 @@ async def confirm_transaction(
amount="", amount="",
amount_title="", amount_title="",
fee=f"{format_amount(fee, 9)} SOL", fee=f"{format_amount(fee, 9)} SOL",
fee_title=TR.label_with_colon_template.format(TR.solana__expected_fee), fee_title=f"{TR.solana__expected_fee}:",
items=( items=(
( (f"{TR.words__account}:", _format_path(signer_path)),
TR.label_with_colon_template.format(TR.words__account), (f"{TR.words__blockhash}:", base58.encode(blockhash)),
_format_path(signer_path),
),
(
TR.label_with_colon_template.format(TR.words__blockhash),
base58.encode(blockhash),
),
), ),
) )

View File

@ -283,7 +283,7 @@ async def confirm_set_options_op(op: StellarSetOptionsOp) -> None:
title = TR.stellar__remove_signer title = TR.stellar__remove_signer
data: str | bytes = "" data: str | bytes = ""
if signer_type == StellarSignerType.ACCOUNT: if signer_type == StellarSignerType.ACCOUNT:
description = TR.label_with_colon_template.format(TR.words__account) description = f"{TR.words__account}:"
data = helpers.address_from_public_key(signer_key) data = helpers.address_from_public_key(signer_key)
elif signer_type == StellarSignerType.PRE_AUTH: elif signer_type == StellarSignerType.PRE_AUTH:
description = TR.stellar__preauth_transaction description = TR.stellar__preauth_transaction

View File

@ -22,7 +22,7 @@ async def require_confirm_fee(value: int, fee: int) -> None:
await confirm_total( await confirm_total(
format_tezos_amount(value), format_tezos_amount(value),
format_tezos_amount(fee), format_tezos_amount(fee),
total_label=TR.label_with_colon_template.format(TR.words__amount), total_label=f"{TR.words__amount}:",
) )
@ -30,7 +30,7 @@ async def require_confirm_origination(address: str) -> None:
await confirm_address( await confirm_address(
TR.tezos__confirm_origination, TR.tezos__confirm_origination,
address, address,
TR.label_with_colon_template.format(TR.words__address), f"{TR.words__address}:",
"confirm_origination", "confirm_origination",
BR_SIGN_TX, BR_SIGN_TX,
) )
@ -42,10 +42,7 @@ async def require_confirm_origination_fee(balance: int, fee: int) -> None:
TR.tezos__confirm_origination, TR.tezos__confirm_origination,
( (
(TR.tezos__balance, format_tezos_amount(balance)), (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, hold=True,
) )
@ -65,7 +62,7 @@ async def require_confirm_set_delegate(fee: int) -> None:
await confirm_metadata( await confirm_metadata(
"confirm_delegation_final", "confirm_delegation_final",
TR.tezos__confirm_delegation, TR.tezos__confirm_delegation,
TR.label_with_colon_template.format(TR.words__fee) + "\n{}", f"{TR.words__fee}:\n{{}}",
format_tezos_amount(fee), format_tezos_amount(fee),
BR_SIGN_TX, BR_SIGN_TX,
hold=True, hold=True,
@ -77,11 +74,8 @@ async def require_confirm_register_delegate(address: str, fee: int) -> None:
"confirm_register_delegate", "confirm_register_delegate",
TR.tezos__register_delegate, TR.tezos__register_delegate,
( (
( (f"{TR.words__fee}:", format_tezos_amount(fee)),
TR.label_with_colon_template.format(TR.words__fee), (f"{TR.words__address}:", address),
format_tezos_amount(fee),
),
(TR.label_with_colon_template.format(TR.words__address), address),
), ),
hold=True, hold=True,
br_code=BR_SIGN_TX, br_code=BR_SIGN_TX,
@ -103,7 +97,7 @@ async def require_confirm_ballot(proposal: str, ballot: str) -> None:
TR.tezos__submit_ballot, TR.tezos__submit_ballot,
( (
(TR.tezos__ballot, ballot), (TR.tezos__ballot, ballot),
(TR.label_with_colon_template.format(TR.tezos__proposal), proposal), (f"{TR.tezos__proposal}:", proposal),
), ),
hold=True, hold=True,
br_code=BR_SIGN_TX, br_code=BR_SIGN_TX,
@ -137,7 +131,7 @@ async def require_confirm_manager_remove_delegate(fee: int) -> None:
await confirm_metadata( await confirm_metadata(
"confirm_undelegation_final", "confirm_undelegation_final",
TR.tezos__remove_delegation, TR.tezos__remove_delegation,
TR.label_with_colon_template.format(TR.words__fee) + "\n{}", f"{TR.words__fee}:\n{{}}",
format_tezos_amount(fee), format_tezos_amount(fee),
BR_SIGN_TX, BR_SIGN_TX,
hold=True, hold=True,

View File

@ -1116,9 +1116,7 @@ if not utils.BITCOIN_ONLY:
br_code: ButtonRequestType = ButtonRequestType.SignTx, br_code: ButtonRequestType = ButtonRequestType.SignTx,
) -> Awaitable[None]: ) -> Awaitable[None]:
amount_title = ( amount_title = (
amount_title amount_title if amount_title is not None else f"{TR.words__amount}:"
if amount_title is not None
else TR.label_with_colon_template.format(TR.words__amount)
) # def_arg ) # def_arg
fee_title = fee_title or TR.words__fee # def_arg fee_title = fee_title or TR.words__fee # def_arg
return _confirm_summary( return _confirm_summary(

View File

@ -1027,9 +1027,7 @@ def confirm_amount(
br_name: str = "confirm_amount", br_name: str = "confirm_amount",
br_code: ButtonRequestType = BR_CODE_OTHER, br_code: ButtonRequestType = BR_CODE_OTHER,
) -> Awaitable[None]: ) -> Awaitable[None]:
description = description or TR.label_with_colon_template.format( description = description or f"{TR.words__amount}:" # def_arg
TR.words__amount
) # def_arg
return confirm_blob( return confirm_blob(
br_name, br_name,
title, title,
@ -1165,9 +1163,7 @@ def confirm_total(
br_name: str = "confirm_total", br_name: str = "confirm_total",
br_code: ButtonRequestType = ButtonRequestType.SignTx, br_code: ButtonRequestType = ButtonRequestType.SignTx,
) -> Awaitable[None]: ) -> Awaitable[None]:
total_label = total_label or TR.label_with_colon_template.format( total_label = total_label or f"{TR.send__total_amount}:" # def_arg
TR.send__total_amount
) # def_arg
fee_label = fee_label or TR.send__including_fee # def_arg fee_label = fee_label or TR.send__including_fee # def_arg
return raise_if_not_confirmed( return raise_if_not_confirmed(
interact( interact(
@ -1220,7 +1216,7 @@ if not utils.BITCOIN_ONLY:
amount_title = verb amount_title = verb
amount_value = "" amount_value = ""
else: else:
amount_title = TR.label_with_colon_template.format(TR.words__amount) amount_title = f"{TR.words__amount}:"
amount_value = total_amount amount_value = total_amount
await raise_if_not_confirmed( await raise_if_not_confirmed(
interact( interact(
@ -1228,14 +1224,9 @@ if not utils.BITCOIN_ONLY:
trezorui2.altcoin_tx_summary( trezorui2.altcoin_tx_summary(
amount_title=amount_title, amount_title=amount_title,
amount_value=amount_value, amount_value=amount_value,
fee_title=TR.label_with_colon_template.format( fee_title=f"{TR.send__maximum_fee}:",
TR.send__maximum_fee
),
fee_value=maximum_fee, fee_value=maximum_fee,
items=[ items=[(f"{k}:", v) for (k, v) in info_items],
(TR.label_with_colon_template.format(k), v)
for (k, v) in info_items
],
cancel_cross=True, cancel_cross=True,
) )
), ),
@ -1254,9 +1245,7 @@ if not utils.BITCOIN_ONLY:
br_code: ButtonRequestType = ButtonRequestType.SignTx, br_code: ButtonRequestType = ButtonRequestType.SignTx,
) -> Awaitable[None]: ) -> Awaitable[None]:
amount_title = ( amount_title = (
amount_title amount_title if amount_title is not None else f"{TR.words__amount}:"
if amount_title is not None
else TR.label_with_colon_template.format(TR.words__amount)
) # def_arg ) # def_arg
fee_title = fee_title or TR.words__fee # def_arg fee_title = fee_title or TR.words__fee # def_arg
return raise_if_not_confirmed( return raise_if_not_confirmed(
@ -1287,14 +1276,11 @@ if not utils.BITCOIN_ONLY:
) -> None: ) -> None:
summary_layout = RustLayout( summary_layout = RustLayout(
trezorui2.altcoin_tx_summary( trezorui2.altcoin_tx_summary(
amount_title=TR.label_with_colon_template.format(TR.words__amount), amount_title=f"{TR.words__amount}:",
amount_value=total_amount, amount_value=total_amount,
fee_title=TR.label_with_colon_template.format(TR.send__maximum_fee), fee_title=f"{TR.send__maximum_fee}:",
fee_value=maximum_fee, fee_value=maximum_fee,
items=[ items=[(f"{k}:", v) for (k, v) in fee_info_items],
(TR.label_with_colon_template.format(k), v)
for (k, v) in fee_info_items
],
) )
) )
@ -1377,7 +1363,7 @@ async def confirm_modify_output(
data=address, data=address,
verb=TR.buttons__continue, verb=TR.buttons__continue,
verb_cancel=None, verb_cancel=None,
description=TR.label_with_colon_template.format(TR.words__address), description=f"{TR.words__address}:",
extra=None, extra=None,
) )
) )

View File

@ -942,9 +942,7 @@ def confirm_amount(
br_name: str = "confirm_amount", br_name: str = "confirm_amount",
br_code: ButtonRequestType = BR_CODE_OTHER, br_code: ButtonRequestType = BR_CODE_OTHER,
) -> Awaitable[None]: ) -> Awaitable[None]:
description = description or TR.label_with_colon_template.format( description = description or f"{TR.words__amount}:" # def_arg
TR.words__amount
) # def_arg
return confirm_value( return confirm_value(
title, title,
amount, amount,
@ -1043,9 +1041,7 @@ def confirm_total(
br_code: ButtonRequestType = ButtonRequestType.SignTx, br_code: ButtonRequestType = ButtonRequestType.SignTx,
) -> Awaitable[None]: ) -> Awaitable[None]:
title = title or TR.words__title_summary # def_arg title = title or TR.words__title_summary # def_arg
total_label = total_label or TR.label_with_colon_template.format( total_label = total_label or f"{TR.send__total_amount}:" # def_arg
TR.send__total_amount
) # def_arg
fee_label = fee_label or TR.send__including_fee # def_arg fee_label = fee_label or TR.send__including_fee # def_arg
items = [ items = [
@ -1056,12 +1052,7 @@ def confirm_total(
if source_account: if source_account:
info_items.append((TR.confirm_total__sending_from_account, source_account)) info_items.append((TR.confirm_total__sending_from_account, source_account))
if fee_rate_amount: if fee_rate_amount:
info_items.append( info_items.append((f"{TR.confirm_total__fee_rate}:", fee_rate_amount))
(
TR.label_with_colon_template.format(TR.confirm_total__fee_rate),
fee_rate_amount,
)
)
return _confirm_summary( return _confirm_summary(
items, items,
@ -1116,14 +1107,8 @@ if not utils.BITCOIN_ONLY:
trezorui2.confirm_total( trezorui2.confirm_total(
title=TR.words__title_summary, title=TR.words__title_summary,
items=[ items=[
( (f"{TR.words__amount}:", total_amount),
TR.label_with_colon_template.format(TR.words__amount), (f"{TR.send__maximum_fee}:", maximum_fee),
total_amount,
),
(
TR.label_with_colon_template.format(TR.send__maximum_fee),
maximum_fee,
),
], ],
info_button=True, info_button=True,
cancel_arrow=True, cancel_arrow=True,
@ -1132,10 +1117,7 @@ if not utils.BITCOIN_ONLY:
info_layout = RustLayout( info_layout = RustLayout(
trezorui2.show_info_with_cancel( trezorui2.show_info_with_cancel(
title=TR.confirm_total__title_fee, title=TR.confirm_total__title_fee,
items=[ items=[(f"{k}:", v) for (k, v) in fee_info_items],
(TR.label_with_colon_template.format(k), v)
for (k, v) in fee_info_items
],
) )
) )
@ -1187,27 +1169,17 @@ if not utils.BITCOIN_ONLY:
# confirmation # confirmation
if verb == TR.ethereum__staking_claim: if verb == TR.ethereum__staking_claim:
items = ( items = ((f"{TR.send__maximum_fee}:", maximum_fee),)
(
TR.label_with_colon_template.format(TR.send__maximum_fee),
maximum_fee,
),
)
else: else:
items = ( items = (
(TR.label_with_colon_template.format(TR.words__amount), total_amount), (f"{TR.words__amount}:", total_amount),
( (f"{TR.send__maximum_fee}:", maximum_fee),
TR.label_with_colon_template.format(TR.send__maximum_fee),
maximum_fee,
),
) )
await _confirm_summary( await _confirm_summary(
items, # items items, # items
title=title, title=title,
info_title=TR.confirm_total__title_fee, info_title=TR.confirm_total__title_fee,
info_items=[ info_items=[(f"{k}:", v) for (k, v) in info_items],
(TR.label_with_colon_template.format(k), v) for (k, v) in info_items
],
br_name=br_name, br_name=br_name,
br_code=br_code, br_code=br_code,
) )
@ -1222,9 +1194,7 @@ if not utils.BITCOIN_ONLY:
br_code: ButtonRequestType = ButtonRequestType.SignTx, br_code: ButtonRequestType = ButtonRequestType.SignTx,
) -> Awaitable[None]: ) -> Awaitable[None]:
amount_title = ( amount_title = (
amount_title amount_title if amount_title is not None else f"{TR.words__amount}:"
if amount_title is not None
else TR.label_with_colon_template.format(TR.words__amount)
) # def_arg ) # def_arg
fee_title = fee_title or TR.words__fee # def_arg fee_title = fee_title or TR.words__fee # def_arg
return _confirm_summary( return _confirm_summary(
@ -1298,7 +1268,7 @@ async def confirm_modify_output(
data=address, data=address,
verb=TR.buttons__continue, verb=TR.buttons__continue,
verb_cancel=None, verb_cancel=None,
description=TR.label_with_colon_template.format(TR.words__address), description=f"{TR.words__address}:",
extra=None, extra=None,
) )
) )
@ -1442,16 +1412,9 @@ async def confirm_signverify(
items: list[tuple[str, str]] = [] items: list[tuple[str, str]] = []
if account is not None: if account is not None:
items.append((TR.label_with_colon_template.format(TR.words__account), account)) items.append((f"{TR.words__account}:", account))
if path is not None: if path is not None:
items.append( items.append((f"{TR.address_details__derivation_path}:", path))
(
TR.label_with_colon_template.format(
TR.address_details__derivation_path
),
path,
)
)
items.append( items.append(
( (
TR.sign_message__message_size, TR.sign_message__message_size,

View File

@ -423,7 +423,6 @@
"joint__title": "Společná transakce", "joint__title": "Společná transakce",
"joint__to_the_total_amount": "Do celkové částky:", "joint__to_the_total_amount": "Do celkové částky:",
"joint__you_are_contributing": "Přispíváte:", "joint__you_are_contributing": "Přispíváte:",
"label_with_colon_template": "{0}:",
"language__change_to_template": "Změnit jazyk na {0}?", "language__change_to_template": "Změnit jazyk na {0}?",
"language__changed": "Jazyk byl změněn", "language__changed": "Jazyk byl změněn",
"language__progress": "Změna jazyka", "language__progress": "Změna jazyka",

View File

@ -423,7 +423,6 @@
"joint__title": "Gemeins. transakt.", "joint__title": "Gemeins. transakt.",
"joint__to_the_total_amount": "Gesamtbetrag:", "joint__to_the_total_amount": "Gesamtbetrag:",
"joint__you_are_contributing": "Dein Anteil:", "joint__you_are_contributing": "Dein Anteil:",
"label_with_colon_template": "{0}:",
"language__change_to_template": "Sprache in {0} ändern?", "language__change_to_template": "Sprache in {0} ändern?",
"language__changed": "Die Sprache änderte sich erfolgreich", "language__changed": "Die Sprache änderte sich erfolgreich",
"language__progress": "Sprache ändern", "language__progress": "Sprache ändern",

View File

@ -400,7 +400,6 @@
"joint__title": "Joint transaction", "joint__title": "Joint transaction",
"joint__to_the_total_amount": "To the total amount:", "joint__to_the_total_amount": "To the total amount:",
"joint__you_are_contributing": "You are contributing:", "joint__you_are_contributing": "You are contributing:",
"label_with_colon_template": "{0}:",
"language__change_to_template": "Change language to {0}?", "language__change_to_template": "Change language to {0}?",
"language__changed": "Language changed successfully", "language__changed": "Language changed successfully",
"language__progress": "Changing language", "language__progress": "Changing language",

View File

@ -423,7 +423,6 @@
"joint__title": "Transacc. conjunta", "joint__title": "Transacc. conjunta",
"joint__to_the_total_amount": "Al importe total:", "joint__to_the_total_amount": "Al importe total:",
"joint__you_are_contributing": "Estás aportando:", "joint__you_are_contributing": "Estás aportando:",
"label_with_colon_template": "{0}:",
"language__change_to_template": "Cambiar el idioma a {0}?", "language__change_to_template": "Cambiar el idioma a {0}?",
"language__changed": "El lenguaje cambió con éxito", "language__changed": "El lenguaje cambió con éxito",
"language__progress": "Lenguaje cambiante", "language__progress": "Lenguaje cambiante",

View File

@ -423,7 +423,6 @@
"joint__title": "Trans. commune", "joint__title": "Trans. commune",
"joint__to_the_total_amount": "Au montant total:", "joint__to_the_total_amount": "Au montant total:",
"joint__you_are_contributing": "Votre contribution:", "joint__you_are_contributing": "Votre contribution:",
"label_with_colon_template": "{0}:",
"language__change_to_template": "Changer la langue en {0} ?", "language__change_to_template": "Changer la langue en {0} ?",
"language__changed": "La langue a changé avec succès", "language__changed": "La langue a changé avec succès",
"language__progress": "Langage changeant", "language__progress": "Langage changeant",

View File

@ -964,6 +964,5 @@
"962": "fido__title_for_authentication", "962": "fido__title_for_authentication",
"963": "fido__title_select_credential", "963": "fido__title_select_credential",
"964": "instructions__swipe_down", "964": "instructions__swipe_down",
"965": "fido__title_credential_details", "965": "fido__title_credential_details"
"966": "label_with_colon_template"
} }

View File

@ -1,8 +1,8 @@
{ {
"current": { "current": {
"merkle_root": "bcfcf3a7596b3c34dff25e340c40c1264b996dce5d2dc082c0a6657bb5383c86", "merkle_root": "3f354ff51c2d3855bf128509cd29b88c442eb7421f40e3788c1999cbbbe852eb",
"datetime": "2024-09-16T08:03:17.940712", "datetime": "2024-09-16T08:04:38.685162",
"commit": "e489a1c6dbad936f9011d096fcdc8fab56ed2f6c" "commit": "1fac12992b035ba9ed86399ba00d52ca44cc9bc5"
}, },
"history": [ "history": [
{ {