From e29d96be64453fe64f45b36bf7d6d9bb46d7f1e9 Mon Sep 17 00:00:00 2001 From: Tangem Date: Fri, 7 Nov 2025 10:54:28 +0500 Subject: [PATCH] Updated on 2026-08-14 --- core/res/src/main/res/values/strings.xml | 2 ++ .../forgetwallet/ForgetWalletModel.kt | 10 ++++----- .../forgetwallet/ui/ForgetWalletContent.kt | 13 +++++------ .../model/WalletHardwareBackupModel.kt | 17 +++++--------- .../model/WalletSettingsModel.kt | 22 +++++++++---------- 5 files changed, 28 insertions(+), 36 deletions(-) diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml index dd4481e3db..6b1af5876a 100644 --- a/core/res/src/main/res/values/strings.xml +++ b/core/res/src/main/res/values/strings.xml @@ -574,10 +574,12 @@ Go to backup Please back up your wallet before creating an access code. Finalize backup first + Finish backup first Incomplete Other methods Physical devices that securely store your private key offline. Recovery phrase + To secure your wallet with a Access Code, complete the backup first. To upgrade your wallet to hardware, back it up first. Your private keys are securely encrypted and stored on your phone Keys are stored in the app diff --git a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/forgetwallet/ForgetWalletModel.kt b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/forgetwallet/ForgetWalletModel.kt index 7c146e24d3..3a7f9f584b 100644 --- a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/forgetwallet/ForgetWalletModel.kt +++ b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/forgetwallet/ForgetWalletModel.kt @@ -8,7 +8,6 @@ import com.tangem.core.decompose.model.ParamsContainer import com.tangem.core.decompose.navigation.Router import com.tangem.core.decompose.ui.UiMessageSender import com.tangem.core.ui.extensions.resourceReference -import com.tangem.core.ui.extensions.stringReference import com.tangem.core.ui.message.DialogMessage import com.tangem.core.ui.message.EventMessageAction import com.tangem.core.ui.message.SnackbarMessage @@ -69,21 +68,20 @@ internal class ForgetWalletModel @Inject constructor( } private fun onForgetWalletClick() { - // TODO actualize strings [REDACTED_TASK_KEY] uiMessageSender.send( DialogMessage( - title = stringReference("Attention"), - message = stringReference("Are you sure you want to do this?"), + title = resourceReference(R.string.common_attention), + message = resourceReference(R.string.hw_remove_wallet_confirmation_title), firstActionBuilder = { EventMessageAction( - title = stringReference("Forget"), + title = resourceReference(R.string.common_forget), isWarning = true, onClick = ::forgetWallet, ) }, secondActionBuilder = { EventMessageAction( - title = stringReference("Cancel"), + title = resourceReference(R.string.common_cancel), onClick = {}, ) }, diff --git a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/forgetwallet/ui/ForgetWalletContent.kt b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/forgetwallet/ui/ForgetWalletContent.kt index 7b7f5592a9..5e4d2f42ec 100644 --- a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/forgetwallet/ui/ForgetWalletContent.kt +++ b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/forgetwallet/ui/ForgetWalletContent.kt @@ -18,6 +18,7 @@ import com.tangem.core.ui.components.PrimaryButton import com.tangem.core.ui.components.appbar.TangemTopAppBar import com.tangem.core.ui.components.appbar.models.TopAppBarButtonUM import com.tangem.core.ui.extensions.TextReference +import com.tangem.core.ui.extensions.stringResourceSafe import com.tangem.core.ui.res.TangemTheme import com.tangem.core.ui.res.TangemThemePreview import com.tangem.features.hotwallet.forgetwallet.entity.ForgetWalletUM @@ -26,7 +27,6 @@ import com.tangem.features.hotwallet.forgetwallet.entity.ForgetWalletUM @OptIn(ExperimentalMaterial3Api::class) @Composable internal fun ForgetWalletContent(state: ForgetWalletUM, modifier: Modifier = Modifier) { - // TODO actualize strings [REDACTED_TASK_KEY] Column( modifier = modifier .background(TangemTheme.colors.background.primary) @@ -53,14 +53,14 @@ internal fun ForgetWalletContent(state: ForgetWalletUM, modifier: Modifier = Mod ) Spacer(modifier = Modifier.height(24.dp)) Text( - text = "Attention", + text = stringResourceSafe(R.string.common_attention), style = TangemTheme.typography.h2, color = TangemTheme.colors.text.primary1, textAlign = TextAlign.Center, ) Spacer(modifier = Modifier.height(12.dp)) Text( - text = "This wallet will be permanently removed from your device", + text = stringResourceSafe(R.string.hw_remove_wallet_attention_description), style = TangemTheme.typography.body1, color = TangemTheme.colors.text.secondary, textAlign = TextAlign.Center, @@ -72,21 +72,21 @@ internal fun ForgetWalletContent(state: ForgetWalletUM, modifier: Modifier = Mod modifier = Modifier.padding(horizontal = 16.dp), checked = state.firstCheckboxChecked, onCheckedChange = state.onFirstCheckboxClick, - text = "I understand that removing my wallet does not delete it—but simply removes it from my device.", + text = stringResourceSafe(R.string.hw_remove_wallet_warning_device), ) Spacer(modifier = Modifier.height(16.dp)) CheckboxItem( modifier = Modifier.padding(horizontal = 16.dp), checked = state.secondCheckboxChecked, onCheckedChange = state.onSecondCheckboxClick, - text = "I understand that if I haven't backed up my wallet before removing it, I may lose access to it.", + text = stringResourceSafe(R.string.hw_remove_wallet_warning_access), ) Spacer(modifier = Modifier.height(32.dp)) PrimaryButton( modifier = Modifier .fillMaxWidth() .padding(16.dp), - text = "Forget wallet", + text = stringResourceSafe(R.string.hw_remove_wallet_action_forget_title), onClick = state.onForgetWalletClick, enabled = state.isForgetButtonEnabled, ) @@ -95,7 +95,6 @@ internal fun ForgetWalletContent(state: ForgetWalletUM, modifier: Modifier = Mod @Composable private fun CheckboxItem(checked: Boolean, onCheckedChange: () -> Unit, text: String, modifier: Modifier = Modifier) { - // TODO actualize strings [REDACTED_TASK_KEY] Row( modifier = modifier.fillMaxWidth(), horizontalArrangement = Arrangement.Start, diff --git a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/wallethardwarebackup/model/WalletHardwareBackupModel.kt b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/wallethardwarebackup/model/WalletHardwareBackupModel.kt index a434fc39d0..5b85a497b5 100644 --- a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/wallethardwarebackup/model/WalletHardwareBackupModel.kt +++ b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/wallethardwarebackup/model/WalletHardwareBackupModel.kt @@ -16,7 +16,6 @@ import com.tangem.core.ui.components.bottomsheets.message.primaryButton import com.tangem.core.ui.components.label.entity.LabelStyle import com.tangem.core.ui.components.label.entity.LabelUM import com.tangem.core.ui.extensions.resourceReference -import com.tangem.core.ui.extensions.stringReference import com.tangem.core.ui.message.bottomSheetMessage import com.tangem.domain.models.wallet.UserWallet import com.tangem.domain.wallets.usecase.GenerateBuyTangemCardLinkUseCase @@ -51,7 +50,6 @@ internal class WalletHardwareBackupModel @Inject constructor( private val params = paramsContainer.require() - // TODO actualize strings [REDACTED_TASK_KEY] private val makeBackupAtFirstAlertBS get() = bottomSheetMessage { infoBlock { @@ -59,8 +57,8 @@ internal class WalletHardwareBackupModel @Inject constructor( type = MessageBottomSheetUMV2.Icon.Type.Accent backgroundType = MessageBottomSheetUMV2.Icon.BackgroundType.SameAsTint } - title = stringReference("Finish Backup First") - body = stringReference("To upgrade your wallet to hardware, back it up first.") + title = resourceReference(R.string.hw_backup_need_finish_first) + body = resourceReference(R.string.hw_backup_to_upgrade_description) } primaryButton { text = resourceReference(R.string.hw_backup_need_action) @@ -76,27 +74,24 @@ internal class WalletHardwareBackupModel @Inject constructor( } } - // TODO actualize strings [REDACTED_TASK_KEY] internal val uiState: StateFlow field = MutableStateFlow( WalletHardwareBackupUM( onBackClick = { router.pop() }, blocks = persistentListOf( WalletHardwareBackupUM.Block( - title = stringReference("Create new wallet"), + title = resourceReference(R.string.hw_backup_hardware_create_title), titleLabel = LabelUM( text = resourceReference(R.string.common_recommended), style = LabelStyle.ACCENT, ), - description = stringReference( - "Create a new secure wallet and transfer your funds for extra protection.", - ), + description = resourceReference(R.string.hw_backup_hardware_create_description), onClick = ::onCreateNewWalletClick, ), WalletHardwareBackupUM.Block( - title = stringReference("Upgrade current wallet"), + title = resourceReference(R.string.hw_backup_hardware_upgrade_title), titleLabel = null, - description = stringReference("Move your current wallet into Tangem Wallet."), + description = resourceReference(R.string.hw_backup_hardware_upgrade_description), onClick = ::onUpgradeCurrentWalletClick, ), ), diff --git a/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/model/WalletSettingsModel.kt b/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/model/WalletSettingsModel.kt index 31185e6adf..f207f3a7e3 100644 --- a/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/model/WalletSettingsModel.kt +++ b/features/wallet-settings/impl/src/main/kotlin/com/tangem/feature/walletsettings/model/WalletSettingsModel.kt @@ -19,7 +19,6 @@ import com.tangem.core.decompose.ui.UiMessageSender import com.tangem.core.navigation.settings.SettingsManager import com.tangem.core.ui.components.bottomsheets.message.* import com.tangem.core.ui.extensions.resourceReference -import com.tangem.core.ui.extensions.stringReference import com.tangem.core.ui.message.DialogMessage import com.tangem.core.ui.message.EventMessageAction import com.tangem.core.ui.message.SnackbarMessage @@ -385,8 +384,8 @@ internal class WalletSettingsModel @Inject constructor( type = MessageBottomSheetUMV2.Icon.Type.Accent backgroundType = MessageBottomSheetUMV2.Icon.BackgroundType.SameAsTint } - title = resourceReference(R.string.hw_backup_need_title) - body = resourceReference(R.string.hw_backup_need_description) + title = resourceReference(R.string.hw_backup_need_finish_first) + body = resourceReference(R.string.hw_backup_to_secure_description) } primaryButton { text = resourceReference(R.string.hw_backup_need_action) @@ -442,8 +441,7 @@ internal class WalletSettingsModel @Inject constructor( // TODO() Implement saving the new order of accounts } - // TODO actualize strings [REDACTED_TASK_KEY] and remove MaximumLineLength - @Suppress("LongMethod", "MaximumLineLength") + @Suppress("LongMethod") private fun onForgetWalletClick(userWallet: UserWallet) { val message = when (userWallet) { is UserWallet.Cold -> { @@ -468,16 +466,16 @@ internal class WalletSettingsModel @Inject constructor( type = MessageBottomSheetUMV2.Icon.Type.Warning backgroundType = MessageBottomSheetUMV2.Icon.BackgroundType.SameAsTint } - title = stringReference("Forget this wallet?") + title = resourceReference(R.string.hw_remove_wallet_notification_title) body = if (userWallet.backedUp) { - stringReference("A backup for this wallet exists. Review it before forgetting to make sure you can recover later.") + resourceReference(R.string.hw_remove_wallet_notification_description_has_backup) } else { - stringReference("If you forget this wallet without a backup, you’ll permanently lose access to your funds.") + resourceReference(R.string.hw_remove_wallet_notification_description_without_backup) } } if (userWallet.backedUp) { secondaryButton { - text = stringReference("Forget wallet") + text = resourceReference(R.string.hw_remove_wallet_notification_action_forget) onClick { router.push(AppRoute.ForgetWallet(userWallet.walletId)) closeBs() @@ -485,7 +483,7 @@ internal class WalletSettingsModel @Inject constructor( } } else { secondaryButton { - text = stringReference("Forget Anyway") + text = resourceReference(R.string.hw_remove_wallet_notification_action_forget_anyway) onClick { router.push(AppRoute.ForgetWallet(userWallet.walletId)) closeBs() @@ -494,7 +492,7 @@ internal class WalletSettingsModel @Inject constructor( } if (userWallet.backedUp) { primaryButton { - text = stringReference("View backup") + text = resourceReference(R.string.hw_remove_wallet_notification_action_backup_view) onClick { unlockWalletIfNeedAndProceed { router.push(AppRoute.ViewPhrase(userWallet.walletId)) @@ -504,7 +502,7 @@ internal class WalletSettingsModel @Inject constructor( } } else { primaryButton { - text = stringReference("Go to backup") + text = resourceReference(R.string.hw_remove_wallet_notification_action_backup_go) onClick { router.push( AppRoute.CreateWalletBackup(