Skip to content
Open
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
2 changes: 2 additions & 0 deletions core/embed/rust/librust_qstr.h
Original file line number Diff line number Diff line change
Expand Up @@ -1048,9 +1048,11 @@ static void _librust_qstrs(void) {
MP_QSTR_words__staking_from;
MP_QSTR_words__swap;
MP_QSTR_words__title_check;
MP_QSTR_words__title_confirm;
MP_QSTR_words__title_done;
MP_QSTR_words__title_group;
MP_QSTR_words__title_information;
MP_QSTR_words__title_provider;
MP_QSTR_words__title_remember;
MP_QSTR_words__title_share;
MP_QSTR_words__title_shares;
Expand Down
36,342 changes: 18,205 additions & 18,137 deletions core/embed/rust/src/translations/generated/translated_string.rs

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions core/embed/upymod/qstrdefsport.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ Q(payment_request)
Q(pin)
Q(power_management)
Q(progress)
Q(properties)
Q(protobuf)
Q(protocol_common)
Q(readers)
Expand Down Expand Up @@ -390,7 +389,6 @@ Q(trezor.ui.layouts.fido)
Q(trezor.ui.layouts.homescreen)
Q(trezor.ui.layouts.menu)
Q(trezor.ui.layouts.progress)
Q(trezor.ui.layouts.properties)
Q(trezor.ui.layouts.recovery)
Q(trezor.ui.layouts.reset)
Q(trezor.ui.layouts.slip24)
Expand Down
284 changes: 143 additions & 141 deletions core/mocks/trezortranslate_keys.pyi

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions core/src/apps/cardano/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ async def confirm_native_script() -> None:
script_type_name_suffix = ""
if script_type == CNST.PUB_KEY:
if key_path:
script_type_name_suffix = "path"
script_type_name_suffix = "path:"
elif key_hash:
script_type_name_suffix = "hash"
script_type_name_suffix = "hash:"

props: list[StrPropertyType] = [
(
Expand Down Expand Up @@ -767,9 +767,9 @@ async def confirm_stake_pool_parameters(
(TR.cardano__pool_reward_account, pool_parameters.reward_account, True),
(
None,
f"{TR.cardano__pledge}: {format_coin_amount(pool_parameters.pledge, network_id)}\n"
+ f"{TR.cardano__cost}: {format_coin_amount(pool_parameters.cost, network_id)}\n"
+ f"{TR.cardano__margin}: {percentage_formatted}%",
f"{TR.cardano__pledge} {format_coin_amount(pool_parameters.pledge, network_id)}\n"
+ f"{TR.cardano__cost} {format_coin_amount(pool_parameters.cost, network_id)}\n"
+ f"{TR.cardano__margin} {percentage_formatted}%",
None,
),
),
Expand Down
4 changes: 2 additions & 2 deletions core/src/apps/tezos/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,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{{}}",
f"{TR.words__fee}\n{{}}",
format_tezos_amount(fee),
BR_SIGN_TX,
hold=True,
Expand Down Expand Up @@ -131,7 +131,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{{}}",
f"{TR.words__fee}\n{{}}",
format_tezos_amount(fee),
BR_SIGN_TX,
hold=True,
Expand Down
65 changes: 28 additions & 37 deletions core/src/trezor/ui/layouts/bolt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ async def confirm_payment_request(
) -> None:
from ..slip24 import is_swap

title = TR.words__swap if is_swap(trades) else TR.words__confirm
title = TR.words__swap if is_swap(trades) else TR.words__title_confirm

for t, text in texts:
await raise_if_not_confirmed(
Expand Down Expand Up @@ -528,10 +528,10 @@ async def confirm_payment_request(
await with_info(
trezorui_api.confirm_value(
title=title,
subtitle=TR.words__provider,
subtitle=TR.words__title_provider,
value=recipient_name,
description=None,
verb=TR.words__confirm,
verb=TR.buttons__confirm,
verb_cancel=None,
chunkify=False,
info=True,
Expand Down Expand Up @@ -851,7 +851,7 @@ 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.words__amount # def_arg
return confirm_value(
title,
amount,
Expand Down Expand Up @@ -920,9 +920,7 @@ def confirm_properties(
br_code: ButtonRequestType = ButtonRequestType.ConfirmOutput,
verb: str | None = None,
) -> Awaitable[None]:
from ..properties import with_colon

items = with_colon(
items = list(
(
prop[0],
(utils.hexlify_if_bytes(prop[1]) if prop[1] else None),
Expand Down Expand Up @@ -987,32 +985,30 @@ def _confirm_summary(
br_name: str = "confirm_total",
br_code: ButtonRequestType = ButtonRequestType.SignTx,
) -> Awaitable[None]:
from ..properties import with_colon

title = title or TR.words__title_summary # def_arg

account_items_colon = with_colon(account_items)
extra_items_colon = with_colon(extra_items)
account_items_list = list(account_items) if account_items is not None else None
extra_items_list = list(extra_items) if extra_items is not None else None
total_layout = trezorui_api.confirm_summary(
amount=amount,
amount_label=with_colon(amount_label),
amount_label=amount_label,
fee=fee,
fee_label=with_colon(fee_label),
fee_label=fee_label,
title=title,
account_items=account_items_colon,
account_items=account_items_list,
account_title=account_title,
extra_items=extra_items_colon,
extra_items=extra_items_list,
)

# TODO: use `_info` params directly in this^ layout instead of using `with_info`
info_props_colon: list[StrPropertyType] = []
if account_items_colon:
info_props_colon.extend(account_items_colon)
if extra_items_colon:
info_props_colon.extend(extra_items_colon)
info_props: list[StrPropertyType] = []
if account_items_list:
info_props.extend(account_items_list)
if extra_items_list:
info_props.extend(extra_items_list)
info_layout = trezorui_api.show_info_with_cancel(
title=extra_title if extra_title else TR.words__title_information,
items=info_props_colon,
items=info_props,
)
return with_info(total_layout, info_layout, br_name, br_code)

Expand Down Expand Up @@ -1073,12 +1069,11 @@ async def confirm_ethereum_tx(
br_code: ButtonRequestType = ButtonRequestType.SignTx,
chunkify: bool = False,
) -> None:
from ..properties import with_colon

if is_send:
description = f"{TR.words__recipient}:"
description = TR.words__recipient
else:
description = f"{TR.ethereum__interaction_contract}:" if recipient else None
description = TR.ethereum__interaction_contract if recipient else None

address_layout = trezorui_api.confirm_value(
title=TR.words__address,
Expand All @@ -1090,7 +1085,7 @@ async def confirm_ethereum_tx(
chunkify=(chunkify if recipient else False),
)

items = with_colon(
items: list[StrPropertyType] = list(
(
(TR.words__account, account, None),
(TR.address_details__derivation_path, account_path, None),
Expand All @@ -1101,13 +1096,13 @@ async def confirm_ethereum_tx(
items=items,
)

extra_items = with_colon(fee_info_items)
extra_items = list(fee_info_items)

total_layout = trezorui_api.confirm_summary(
amount=total_amount,
amount_label=f"{TR.words__amount}:",
amount_label=TR.words__amount,
fee=maximum_fee,
fee_label=f"{TR.send__maximum_fee}:",
fee_label=TR.send__maximum_fee,
title=TR.words__title_summary,
extra_items=extra_items, # used so that info button is shown
extra_title=TR.confirm_total__title_fee,
Expand Down Expand Up @@ -1355,15 +1350,14 @@ async def confirm_solana_staking_tx(
br_name: str = "confirm_solana_staking_tx",
br_code: ButtonRequestType = ButtonRequestType.SignTx,
) -> None:
from ..properties import with_colon

(amount_label, amount, _is_data) = amount_item or ("", "", None)
(fee_label, fee, _is_data) = fee_item

confirm_layout = trezorui_api.confirm_value(
title=title,
description=description,
extra=f"{TR.words__provider}:" if vote_account else None,
extra=TR.words__provider if vote_account else None,
value=vote_account,
verb=TR.buttons__continue,
info=True,
Expand All @@ -1385,7 +1379,7 @@ async def confirm_solana_staking_tx(

info_layout = trezorui_api.show_info_with_cancel(
title=title,
items=with_colon(items),
items=items,
horizontal=True,
)

Expand Down Expand Up @@ -1675,7 +1669,7 @@ async def confirm_modify_output(
value=address,
verb=TR.buttons__continue,
verb_cancel=None,
description=TR.words__address + ":",
description=TR.words__address,
),
"modify_output" if send_button_request else None,
ButtonRequestType.ConfirmOutput,
Expand Down Expand Up @@ -1706,8 +1700,6 @@ def confirm_modify_fee(
total_fee_new: str,
fee_rate_amount: str | None = None,
) -> Awaitable[None]:
from ..properties import with_colon

fee_layout = trezorui_api.confirm_modify_fee(
title=title,
sign=sign,
Expand All @@ -1720,7 +1712,7 @@ def confirm_modify_fee(
items.append((TR.bitcoin__new_fee_rate, fee_rate_amount, None))
info_layout = trezorui_api.show_info_with_cancel(
title=TR.confirm_total__title_fee,
items=with_colon(items),
items=items,
)
return with_info(fee_layout, info_layout, "modify_fee", ButtonRequestType.SignTx)

Expand Down Expand Up @@ -1760,7 +1752,6 @@ async def confirm_signverify(
account: str | None = None,
chunkify: bool = False,
) -> None:
from ..properties import with_colon

if verify:
address_title = TR.sign_message__verify_address
Expand Down Expand Up @@ -1793,7 +1784,7 @@ async def confirm_signverify(

info_layout = trezorui_api.show_info_with_cancel(
title=TR.words__title_information,
items=with_colon(items),
items=items,
horizontal=True,
)

Expand Down
Loading