44import storage .recovery
55from trezor import config , loop , utils , wire
66from trezor .enums import ButtonRequestType
7- from trezor .lvglui .i18n import gettext , i18n_refresh , keys as i18n_keys
7+ from trezor .lvglui .i18n import gettext as _ , i18n_refresh , keys as i18n_keys
88from trezor .lvglui .scrs import fingerprints
99from trezor .messages import Success
1010from trezor .ui .layouts import confirm_action , confirm_reset_device
@@ -44,7 +44,7 @@ async def recovery_device(
4444
4545 if msg .language is not None :
4646 i18n_refresh (msg .language )
47- await show_popup (gettext (i18n_keys .TITLE__PLEASE_WAIT ), None , timeout_ms = 1000 )
47+ await show_popup (_ (i18n_keys .TITLE__PLEASE_WAIT ), None , timeout_ms = 1000 )
4848 # wipe storage to make sure the device is in a clear state
4949 storage .reset ()
5050 if msg .language is not None :
@@ -62,17 +62,13 @@ async def recovery_device(
6262 if msg .dry_run :
6363 curpin , salt = await request_pin_and_sd_salt (
6464 ctx ,
65- gettext (i18n_keys .TITLE__ENTER_PIN ),
65+ _ (i18n_keys .TITLE__ENTER_PIN ),
6666 allow_fingerprint = False ,
6767 standy_wall_only = True ,
6868 )
6969 from apps .common .pin_constants import PinType
7070
71- result = config .check_pin (curpin , salt , PinType .USER_CHECK )
72- if isinstance (result , tuple ):
73- verified , _ = result
74- else :
75- verified = result
71+ verified = config .check_pin (curpin , salt , PinType .USER_CHECK )[0 ]
7672 if not verified :
7773 await error_pin_invalid (ctx )
7874 newpin = None
@@ -131,18 +127,18 @@ async def _continue_dialog(ctx: wire.Context, msg: RecoveryDevice) -> None:
131127 if not msg .dry_run :
132128 await confirm_reset_device (
133129 ctx ,
134- gettext (i18n_keys .SUBTITLE__DEVICE_RECOVER_RESTORE_WALLET ),
130+ _ (i18n_keys .SUBTITLE__DEVICE_RECOVER_RESTORE_WALLET ),
135131 recovery = True ,
136132 )
137133 else :
138134 await confirm_action (
139135 ctx ,
140136 "confirm_seedcheck" ,
141- title = gettext (i18n_keys .TITLE__CHECK_RECOVERY_PHRASE ),
142- description = gettext (
137+ title = _ (i18n_keys .TITLE__CHECK_RECOVERY_PHRASE ),
138+ description = _ (
143139 i18n_keys .SUBTITLE__DEVICE_RECOVER_CHECK_CHECK_RECOVERY_PHRASE
144140 ),
145- verb = gettext (i18n_keys .BUTTON__CONTINUE ),
141+ verb = _ (i18n_keys .BUTTON__CONTINUE ),
146142 icon = "A:/res/check-seed.png" ,
147143 br_code = ButtonRequestType .ProtectCall ,
148144 anim_dir = 2 ,
0 commit comments