diff --git a/MobileWallet.xcodeproj/project.pbxproj b/MobileWallet.xcodeproj/project.pbxproj index fb185732..e77e430a 100644 --- a/MobileWallet.xcodeproj/project.pbxproj +++ b/MobileWallet.xcodeproj/project.pbxproj @@ -333,6 +333,7 @@ 3708D756247FF81900807D72 /* SettingsParentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3708D755247FF81900807D72 /* SettingsParentViewController.swift */; }; 3708D757247FF81900807D72 /* SettingsParentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3708D755247FF81900807D72 /* SettingsParentViewController.swift */; }; 3708D758247FF81900807D72 /* SettingsParentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3708D755247FF81900807D72 /* SettingsParentViewController.swift */; }; + 37098043249CD48A0004ED2E /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 37098045249CD48A0004ED2E /* Localizable.strings */; }; 371189732488FF11004D0CE3 /* CloudKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 371189722488FF11004D0CE3 /* CloudKit.framework */; }; 371A0818247290C000F97713 /* TransitionLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 371A0817247290C000F97713 /* TransitionLabel.swift */; }; 371A0819247290C000F97713 /* TransitionLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 371A0817247290C000F97713 /* TransitionLabel.swift */; }; @@ -699,6 +700,7 @@ 3708D749247FCF2300807D72 /* SettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = ""; }; 3708D751247FF7D000807D72 /* BackupWalletSettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackupWalletSettingsViewController.swift; sourceTree = ""; }; 3708D755247FF81900807D72 /* SettingsParentViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsParentViewController.swift; sourceTree = ""; }; + 37098044249CD48A0004ED2E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; 371189722488FF11004D0CE3 /* CloudKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CloudKit.framework; path = System/Library/Frameworks/CloudKit.framework; sourceTree = SDKROOT; }; 371A0817247290C000F97713 /* TransitionLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransitionLabel.swift; sourceTree = ""; }; 373CCDBC2490B66E00D0A2C9 /* CircularProgressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircularProgressView.swift; sourceTree = ""; }; @@ -1209,6 +1211,7 @@ 37B4449C24890F3000592D92 /* Backup */, 00262EB2236F022000A6C8A0 /* Common */, 00262EB7236F35B200A6C8A0 /* Models */, + 37098045249CD48A0004ED2E /* Localizable.strings */, ); path = MobileWallet; sourceTree = ""; @@ -1712,6 +1715,7 @@ BF191A2023E5AFA200D33C85 /* img_1.png in Resources */, BF0A77B52420CF1200861A3E /* NotificationAnimation.json in Resources */, BFE1FC0223E229FF00BA5EEC /* CheckMark.json in Resources */, + 37098043249CD48A0004ED2E /* Localizable.strings in Resources */, BF191A0D23E5A96700D33C85 /* EmojiWheel.json in Resources */, BFF1EDA32408225900CC9EF6 /* sendingTariAnimation.json in Resources */, BF191A1A23E5AFA200D33C85 /* img_2.png in Resources */, @@ -2443,6 +2447,14 @@ name = LaunchScreen.storyboard; sourceTree = ""; }; + 37098045249CD48A0004ED2E /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + 37098044249CD48A0004ED2E /* en */, + ); + name = Localizable.strings; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ diff --git a/MobileWallet/Backup/ICloudBackup.swift b/MobileWallet/Backup/ICloudBackup.swift index 88cf084f..f7a6f590 100644 --- a/MobileWallet/Backup/ICloudBackup.swift +++ b/MobileWallet/Backup/ICloudBackup.swift @@ -47,26 +47,23 @@ enum ICloudBackupWalletError: Error { case dbFileNotFound case iCloudContainerNotFound case unableCreateBackupFolder - case privateKeyError } extension ICloudBackupWalletError: LocalizedError { public var errorDescription: String? { switch self { case .failedToCreateZip: - return NSLocalizedString("Failed to create wallet backup archive", comment: "backup archive error description") + return NSLocalizedString("iCloud_backup.error.zip", comment: "iCloudBackup error") case .noICloudBackupExists: - return NSLocalizedString("You don't have any wallets backed up with iCloud", comment: "'No any wallet backup' error description") + return NSLocalizedString("iCloud_backup.error.no_backup_exists", comment: "iCloudBackup error") case .unarchiveError: - return NSLocalizedString("Unable to unarchive wallet from iCloud backup", comment: "unarchive wallet error description") + return NSLocalizedString("iCloud_backup.error.unzip", comment: "iCloudBackup error") case .dbFileNotFound: - return NSLocalizedString("Unable to create wallet backup. File not found", comment: "sqlite file not found error description") + return NSLocalizedString("iCloud_backup.error.db_not_found", comment: "iCloudBackup error") case .iCloudContainerNotFound: - return NSLocalizedString("Can't connect to iCloud Drive services. Make sure that you are signed in with your Apple ID on this device and that iCloud is enabled.", comment: "iCloud container not found error description") + return NSLocalizedString("iCloud_backup.error.container_not_found", comment: "iCloudBackup error") case .unableCreateBackupFolder: - return NSLocalizedString("Unable to create backup folder", comment: "Unable to create backup folder error description") - case .privateKeyError: - return NSLocalizedString("Unable to restore wallet. Private key error", comment: "Unable to restore wallet private key error descroption") + return NSLocalizedString("iCloud_backup.error.unable_create_backup_folder", comment: "iCloudBackup error") } } } diff --git a/MobileWallet/Common/BackgroundTasks/ReminderNotifications.swift b/MobileWallet/Common/BackgroundTasks/ReminderNotifications.swift index 902fe2e3..09c4d344 100644 --- a/MobileWallet/Common/BackgroundTasks/ReminderNotifications.swift +++ b/MobileWallet/Common/BackgroundTasks/ReminderNotifications.swift @@ -54,7 +54,7 @@ class ReminderNotifications { static let titleString = String( format: NSLocalizedString( - "You've been sent %@!", + "scheduled_reminder.title.with_param", comment: "Local reminder notifications" ), TariSettings.shared.network.currencyDisplayTicker @@ -64,7 +64,7 @@ class ReminderNotifications { ScheduledReminder( identifier: "scheduled-reminders-recipient-1", title: ReminderNotifications.titleString, - body: NSLocalizedString("Open Tari Aurora", comment: "Local reminder notifications"), + body: NSLocalizedString("scheduled_reminder.body.short", comment: "Local reminder notifications"), deliverAfter: TariSettings.shared.environment == .production ? 60 * 60 * 24 : 60 * 60 * 2 //24h for prod and 2h for debug/testflight ), ScheduledReminder( @@ -72,7 +72,7 @@ class ReminderNotifications { title: ReminderNotifications.titleString, body: String( format: NSLocalizedString( - "Someone sent you %@! Open Tari Aurora to receive it now or it will be returned to the sender.", + "scheduled_reminder.body.long.with_param", comment: "Local reminder notifications" ), TariSettings.shared.network.currencyDisplayTicker diff --git a/MobileWallet/Common/CopyableLabel.swift b/MobileWallet/Common/CopyableLabel.swift index 8ade890f..9a3d7446 100644 --- a/MobileWallet/Common/CopyableLabel.swift +++ b/MobileWallet/Common/CopyableLabel.swift @@ -130,7 +130,7 @@ extension CopyableLabel { greenView.backgroundColor = Theme.shared.colors.transactionCellValuePositiveText?.withAlphaComponent(0.12) let copiedLabel = UILabel() - copiedLabel.text = NSLocalizedString("COPIED", comment: "Emoji ID copied") + copiedLabel.text = NSLocalizedString("emoji.copied", comment: "Emoji view") copiedLabel.font = Theme.shared.fonts.copiedLabelFont copiedLabel.textColor = Theme.shared.colors.textButtonSecondary diff --git a/MobileWallet/Common/DeepLinkManager.swift b/MobileWallet/Common/DeepLinkManager.swift index b69ff3dc..1416ae92 100644 --- a/MobileWallet/Common/DeepLinkManager.swift +++ b/MobileWallet/Common/DeepLinkManager.swift @@ -113,8 +113,8 @@ class DeeplinkNavigator { homeVC.onSend(pubKey: pubKey, deepLinkParams: params) } catch { UserFeedback.shared.error( - title: NSLocalizedString("Invalid link found", comment: "Deep link error"), - description: NSLocalizedString("Could not get emoji ID from link", comment: "Deep link error"), + title: NSLocalizedString("deep_link.error.title", comment: "Deep link error"), + description: NSLocalizedString("deep_link.error.emoji_from_link", comment: "Deep link error"), error: error ) } @@ -140,7 +140,7 @@ class ShortcutParser { let showQRShortcutItem = UIApplicationShortcutItem( type: ShortcutKey.showQR.rawValue, localizedTitle: NSLocalizedString( - "Show my QR", + "shortcut.show_my_qr", comment: "Home screen shortcut" ), localizedSubtitle: nil, @@ -152,8 +152,8 @@ class ShortcutParser { type: ShortcutKey.send.rawValue, localizedTitle: String( format: NSLocalizedString( - "Send %@", - comment: "Home screen shortcut" + "common.send.with_param", + comment: "Common" ), TariSettings.shared.network.currencyDisplayTicker ), diff --git a/MobileWallet/Common/Extensions/Date.swift b/MobileWallet/Common/Extensions/Date.swift index bdfbc88d..ccf005dd 100644 --- a/MobileWallet/Common/Extensions/Date.swift +++ b/MobileWallet/Common/Extensions/Date.swift @@ -47,9 +47,9 @@ extension Date { */ func relativeDayFromToday() -> String? { if Calendar.current.isDateInToday(self) { - return NSLocalizedString("Today", comment: "Transaction list section heading") + return NSLocalizedString("tx_list.today", comment: "Transaction list section heading") } else if Calendar.current.isDateInYesterday(self) { - return NSLocalizedString("Yesterday", comment: "Transaction list section heading") + return NSLocalizedString("tx_list.yesterday", comment: "Transaction list section heading") } else { let dateFormatter = DateFormatter() dateFormatter.dateFormat = DateFormatter.dateFormat(fromTemplate: "MMM d, yyyy", options: 0, locale: .current) diff --git a/MobileWallet/Common/Extensions/LAContext.swift b/MobileWallet/Common/Extensions/LAContext.swift index 3c9bcdd0..eeccd9fa 100644 --- a/MobileWallet/Common/Extensions/LAContext.swift +++ b/MobileWallet/Common/Extensions/LAContext.swift @@ -54,8 +54,8 @@ extension LAContext { var rawValue: String { switch self { - case .logIn: return NSLocalizedString("Log in to your account", comment: "Authentication") - case .userVerification: return NSLocalizedString("User Verification", comment: "Authentication") + case .logIn: return NSLocalizedString("authentication.reason.login", comment: "Authentication") + case .userVerification: return NSLocalizedString("authentication.reason.user_verification", comment: "Authentication") } } } @@ -94,7 +94,7 @@ extension LAContext { if success { onSuccess() } else { - let localizedReason = error?.localizedDescription ?? NSLocalizedString("Failed to authenticate", comment: "Failed Face/Touch ID alert") + let localizedReason = error?.localizedDescription ?? NSLocalizedString("authentication.fail.description", comment: "Authentication") TariLogger.error("Biometrics auth failed", error: error) DispatchQueue.main.async { [weak self] in guard let self = self else { return } @@ -104,16 +104,16 @@ extension LAContext { } } case .none: - let alert = UIAlertController(title: NSLocalizedString("Authentication Error", comment: "No biometric or passcode") , - message: NSLocalizedString("Tari Aurora was not able to authenticate you. Do you still want to proceed?", comment: "No biometric or passcode"), + let alert = UIAlertController(title: NSLocalizedString("authentication.error.title", comment: "Authentication") , + message: NSLocalizedString("authentication.error.description", comment: "Authentication"), preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("Try again", comment: "Try again button"), + alert.addAction(UIAlertAction(title: NSLocalizedString("authentication.try_again", comment: "Authentication"), style: .cancel, handler: { [weak self] _ in self?.authenticateUser(onSuccess: onSuccess) })) - alert.addAction(UIAlertAction(title: NSLocalizedString("Proceed", comment: "Proceed button"), style: .default, handler: { _ in + alert.addAction(UIAlertAction(title: NSLocalizedString("authentication.proceed", comment: "Authentication"), style: .default, handler: { _ in onSuccess() })) @@ -124,13 +124,13 @@ extension LAContext { } private func authenticationFailedAlertOptions(reason: String, onSuccess: @escaping () -> Void) { - let alert = UIAlertController(title: NSLocalizedString("Authentication failed", comment: "Auth failed"), message: reason, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("Try again", comment: "Try again button"), style: .default, handler: { [weak self] _ in + let alert = UIAlertController(title: NSLocalizedString("authentication.fail.title", comment: "Authentication"), message: reason, preferredStyle: .alert) + alert.addAction(UIAlertAction(title: NSLocalizedString("Try again", comment: "Authentication"), style: .default, handler: { [weak self] _ in guard let self = self else { return } self.authenticateUser(onSuccess: onSuccess) })) - alert.addAction(UIAlertAction(title: NSLocalizedString("Open settings", comment: "Open settings button"), style: .default, handler: { [weak self] _ in + alert.addAction(UIAlertAction(title: NSLocalizedString("authentication.action.open_settings", comment: "Authentication"), style: .default, handler: { [weak self] _ in guard let self = self else { return } self.openAppSettings() })) diff --git a/MobileWallet/Common/UserFeedback/FeedbackView.swift b/MobileWallet/Common/UserFeedback/FeedbackView.swift index 0cc22a8c..a9af781c 100644 --- a/MobileWallet/Common/UserFeedback/FeedbackView.swift +++ b/MobileWallet/Common/UserFeedback/FeedbackView.swift @@ -107,7 +107,7 @@ class FeedbackView: UIView { closeButton.setVariation(.secondary) closeButton.translatesAutoresizingMaskIntoConstraints = false addSubview(closeButton) - closeButton.setTitle(NSLocalizedString("Close", comment: "User feedback bottom float"), for: .normal) + closeButton.setTitle(NSLocalizedString("feedback_view.close", comment: "Feedback view"), for: .normal) closeButton.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true closeButton.addTarget(self, action: #selector(onCloseButtonPressed), for: .touchUpInside) } diff --git a/MobileWallet/Common/UserFeedback/UserFeedback.swift b/MobileWallet/Common/UserFeedback/UserFeedback.swift index db4daf13..39b61185 100644 --- a/MobileWallet/Common/UserFeedback/UserFeedback.swift +++ b/MobileWallet/Common/UserFeedback/UserFeedback.swift @@ -166,21 +166,21 @@ class UserFeedback { imageTop: imageTop, title: String( format: NSLocalizedString( - "Spend %@ on exclusive stuff", + "store_modal.title.with_param", comment: "Store modal" ), TariSettings.shared.network.currencyDisplayTicker ), - boldedTitle: NSLocalizedString("exclusive stuff", comment: "Store modal"), + boldedTitle: NSLocalizedString("store_modal.bold_title", comment: "Store modal"), description: String( format: NSLocalizedString( - "Check out The TTL Store to spend your “hard-earned” %@ on exclusive, one-of-a-kind stuff produced by the team at Tari Labs. Enjoy!", + "store_modal.description", comment: "Store modal" ), TariSettings.shared.network.currencyDisplayTicker ), - cancelTitle: NSLocalizedString("I’ll check it out later", comment: "Store modal"), - actionTitle: NSLocalizedString("Visit The TTL Store", comment: "Store modal"), + cancelTitle: NSLocalizedString("store_modal.cancel", comment: "Store modal"), + actionTitle: NSLocalizedString("store_modal.action", comment: "Store modal"), actionIcon: Theme.shared.images.storeIcon!, onClose: { SwiftEntryKit.dismiss() diff --git a/MobileWallet/Screens/AppEntry/Splash/SplashViewController.swift b/MobileWallet/Screens/AppEntry/Splash/SplashViewController.swift index 33c14eea..29342c1e 100644 --- a/MobileWallet/Screens/AppEntry/Splash/SplashViewController.swift +++ b/MobileWallet/Screens/AppEntry/Splash/SplashViewController.swift @@ -135,8 +135,8 @@ class SplashViewController: UIViewController, UITextViewDelegate { let error: Error? = result?.object as? Error UserFeedback.shared.error( - title: NSLocalizedString("Tor connection error", comment: "Splash screen"), - description: NSLocalizedString("Could not establish a connection to the network.", comment: "Splash screen"), + title: NSLocalizedString("tor.error.title", comment: "Tor error"), + description: NSLocalizedString("tor.error.description", comment: "Tor error"), error: error ) } @@ -177,8 +177,8 @@ class SplashViewController: UIViewController, UITextViewDelegate { } catch { DispatchQueue.main.async { UserFeedback.shared.error( - title: NSLocalizedString("Wallet error", comment: "Splash screen"), - description: NSLocalizedString("Error starting existing wallet", comment: "Splash screen"), + title: NSLocalizedString("wallet.error.title", comment: "Wallet error"), + description: NSLocalizedString("wallet.error.start_existing_wallet", comment: "Wallet error"), error: error ) } @@ -200,8 +200,8 @@ class SplashViewController: UIViewController, UITextViewDelegate { } } catch { UserFeedback.shared.error( - title: NSLocalizedString("Wallet error", comment: "Splash screen for new users"), - description: NSLocalizedString("Failed to create a new wallet", comment: "Splash screen for new users"), + title: NSLocalizedString("wallet.error.title", comment: "Wallet error"), + description: NSLocalizedString("wallet.error.create_new_wallet", comment: "Wallet error"), error: error //TODO copy update ) diff --git a/MobileWallet/Screens/AppEntry/Splash/SplashViewControllerSetup.swift b/MobileWallet/Screens/AppEntry/Splash/SplashViewControllerSetup.swift index db5d07bf..54c5b032 100644 --- a/MobileWallet/Screens/AppEntry/Splash/SplashViewControllerSetup.swift +++ b/MobileWallet/Screens/AppEntry/Splash/SplashViewControllerSetup.swift @@ -129,7 +129,7 @@ extension SplashViewController { func setupTitleLabel() { titleLabel.isHidden = true - titleLabel.text = NSLocalizedString("The future of digital assets starts here", comment: "Title Label on the onboarding screen") + titleLabel.text = NSLocalizedString("splash.title", comment: "Splash view") titleLabel.interlineSpacing(spacingValue: 0) titleLabel.numberOfLines = 2 titleLabel.adjustsFontSizeToFitWidth = true @@ -148,7 +148,7 @@ extension SplashViewController { func setupCreateWalletButton() { createWalletButton.isHidden = true - createWalletButton.setTitle(NSLocalizedString("Create Your Wallet", comment: "Main action button on the onboarding screen"), for: .normal) + createWalletButton.setTitle(NSLocalizedString("splash.create_wallet", comment: "Splash view"), for: .normal) createWalletButton.addTarget(self, action: #selector(onCreateWalletTap), for: .touchUpInside) elementsContainer.addSubview(createWalletButton) @@ -166,9 +166,12 @@ extension SplashViewController { disclaimerText.translatesAutoresizingMaskIntoConstraints = false disclaimerText.isEditable = false - let userAgreementLinkText = NSLocalizedString("User Agreement", comment: "Splash screen disclaimer") - let privacyPolicyLinkText = NSLocalizedString("Privacy Policy", comment: "Splash screen disclaimer") - let text = NSLocalizedString("By creating a wallet, you agree to the terms of the User Agreement and Privacy Policy", comment: "Splash screen disclaimer") + let userAgreementLinkText = NSLocalizedString("splash.disclaimer.param.user_agreement", comment: "Splash view") + let privacyPolicyLinkText = NSLocalizedString("splash.disclaimer.param.privacy_policy", comment: "Splash view") + let text = String( + format: NSLocalizedString("splash.disclaimer.with_params", comment: "Splash view"), + userAgreementLinkText, + privacyPolicyLinkText) let attributedText = NSMutableAttributedString(string: text) @@ -212,7 +215,7 @@ extension SplashViewController { restoreButton.tintColor = .white restoreButton.titleLabel?.font = Theme.shared.fonts.restoreWalletButton restoreButton.addTarget(self, action: #selector(onRestoreWalletTap), for: .touchUpInside) - let title = NSLocalizedString("Restore an existing wallet", comment: "Restore button title") + let title = NSLocalizedString("splash.restore_wallet", comment: "Splash view") restoreButton.setTitle(title, for: .normal) elementsContainer.addSubview(restoreButton) diff --git a/MobileWallet/Screens/AppEntry/Splash/WalletCreationViewController.swift b/MobileWallet/Screens/AppEntry/Splash/WalletCreationViewController.swift index c9bcd539..77536387 100644 --- a/MobileWallet/Screens/AppEntry/Splash/WalletCreationViewController.swift +++ b/MobileWallet/Screens/AppEntry/Splash/WalletCreationViewController.swift @@ -233,46 +233,7 @@ class WalletCreationViewController: UIViewController { private func runAuth() { let context = LAContext() - let reason = firstLabel.text ?? "" - - switch context.biometricType { - case .faceID, .touchID, .pin: - let policy: LAPolicy = context.biometricType == .pin ? .deviceOwnerAuthentication : .deviceOwnerAuthenticationWithBiometrics - - context.evaluatePolicy(policy, localizedReason: reason) { - [weak self] success, _ in - - DispatchQueue.main.async { [weak self] in - guard let self = self else { return } - if success { - self.successAuth() - Tracker.shared.track("/onboarding/enable_local_auth", "Onboarding - Enable Local Authentication") - } else { - let alert = UIAlertController(title: NSLocalizedString("There was an error", comment: "Auth failed"), - message: "", - preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("Try again", comment: "Try again button"), - style: .default, - handler: nil)) - - self.present(alert, animated: true, completion: nil) - } - } - } - case .none: - let alert = UIAlertController(title: NSLocalizedString("Authentication Error", comment: "No biometric or passcode"), - message: NSLocalizedString("Tari Aurora was not able to authenticate you. Do you still want to proceed?", comment: "No biometric or passcode"), - preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("Cancel", comment: "Cancel button"), - style: .cancel, - handler: nil)) - - alert.addAction(UIAlertAction(title: NSLocalizedString("Proceed", comment: "Proceed button"), style: .default, handler: { [weak self] _ in - self?.successAuth() - })) - - self.present(alert, animated: true, completion: nil) - } + context.authenticateUser(onSuccess: successAuth) } private func successAuth() { @@ -412,17 +373,17 @@ extension WalletCreationViewController { private func prepareForInitialState() { updateConstraintsAnimationView(animation: .none) - firstLabel.text = NSLocalizedString("Hold on a sec…", comment: "Second label on wallet creation Top") - secondLabel.text = NSLocalizedString("We’re creating your wallet.", comment: "Second label on wallet creation Bottom") - continueButton.setTitle(NSLocalizedString("Create Your Emoji ID", comment: "Create button on wallet creation"), for: .normal) + firstLabel.text = NSLocalizedString("wallet_creation.initial_state.first_label", comment: "WalletCreation view") + secondLabel.text = NSLocalizedString("wallet_creation.initial_state.second_label", comment: "WalletCreation view") + continueButton.setTitle(NSLocalizedString("wallet_creation.button.create", comment: "WalletCreation view"), for: .normal) } private func prepareForCreateEmojiId() { - firstLabel.text = NSLocalizedString("We’re off to a great start!", comment: "Second label on wallet creation Top") - secondLabel.text = NSLocalizedString("Now, let’s create your Emoji ID.", comment: "Second label on wallet creation Bottom") + firstLabel.text = NSLocalizedString("wallet_creation.create_emoji_state.first_label", comment: "WalletCreation view") + secondLabel.text = NSLocalizedString("wallet_creation.create_emoji_state.second_label", comment: "WalletCreation view") thirdLabel.text = String( format: NSLocalizedString( - "Your Emoji ID is your wallet address.\n It’s how your friends can find you and send you %@!", + "wallet_creation.create_emoji_state.description.with_param", comment: "Third label on wallet creation" ), TariSettings.shared.network.currencyDisplayTicker @@ -432,7 +393,7 @@ extension WalletCreationViewController { } private func prepareForShowEmojiID() { - let thisIsYourEmojiString = NSLocalizedString("This is your Emoji ID", comment: "Splash show your emoji ID") + let thisIsYourEmojiString = NSLocalizedString("wallet_creation.emoji_state.first_label", comment: "WalletCreation view") let attributedString = NSMutableAttributedString(string: thisIsYourEmojiString, attributes: [ .font: Theme.shared.fonts.createWalletEmojiIDFirstText!, .foregroundColor: Theme.shared.colors.creatingWalletSecondLabel!, @@ -443,10 +404,10 @@ extension WalletCreationViewController { let curency = TariSettings.shared.network.currencyDisplayTicker thirdLabel.text = NSLocalizedString( - "Your Emoji ID is your wallet’s address, and how others can find you and send you \(curency)!", comment: "Emoji Id third label on wallet creation") + "wallet_creation.emoji_state.second_label", comment: "WalletCreation view") + " \(curency)!" stackView.setCustomSpacing(16, after: secondLabel) - continueButton.setTitle(NSLocalizedString("Continue", comment: "This is your emoji screen on wallet creation"), for: .normal) + continueButton.setTitle(NSLocalizedString("common.continue", comment: "Common"), for: .normal) if let pubKey = TariLib.shared.tariWallet?.publicKey.0 { userEmojiContainer.setUpView( @@ -471,7 +432,7 @@ extension WalletCreationViewController { } private func prepareForLocalAuthentication() { - let secondLabelString = NSLocalizedString("🔑 Let’s secure your wallet. 🔑", comment: "Splash face/touch ID") + let secondLabelString = NSLocalizedString("wallet_creation.secure_your_wallet", comment: "WalletCreation view") let attributedString = NSMutableAttributedString(string: secondLabelString, attributes: [ .font: Theme.shared.fonts.createWalletEmojiIDSecondText!, .foregroundColor: Theme.shared.colors.creatingWalletSecondLabel!, @@ -481,8 +442,8 @@ extension WalletCreationViewController { self.thirdLabel.text = String( format: NSLocalizedString( - "Sleep well at night knowing you’ve taken precautions to keep your %@ wallet safe and sound.", - comment: "Face ID third label on wallet creation" + "wallet_creation.secure_your_wallet.description.with_param", + comment: "WalletCreation view" ), TariSettings.shared.network.currencyDisplayTicker ) @@ -494,27 +455,27 @@ extension WalletCreationViewController { switch currentType { case .faceID: stackView.setCustomSpacing(54, after: animationView) - self.continueButton.setTitle(NSLocalizedString("Secure with Face ID", comment: "Enable authentication on wallet creation"), for: .normal) + self.continueButton.setTitle(NSLocalizedString("wallet_creation.button.secure_face_id", comment: "WalletCreation view"), for: .normal) case .touchID: stackView.setCustomSpacing(58, after: animationView) - self.continueButton.setTitle(NSLocalizedString("Secure with Touch ID", comment: "Enable authentication on wallet creation"), for: .normal) + self.continueButton.setTitle(NSLocalizedString("wallet_creation.button.secure_touch_id", comment: "WalletCreation view"), for: .normal) case .pin, .none: stackView.setCustomSpacing(5, after: numpadImageView) - self.continueButton.setTitle(NSLocalizedString("Secure with Pin", comment: "Enable authentication on wallet creation"), for: .normal) + self.continueButton.setTitle(NSLocalizedString("wallet_creation.button.secure_pin", comment: "WalletCreation view"), for: .normal) } } private func prepareForEnableNotifications() { - let secondLabelStringTop = NSLocalizedString("Don’t miss out when people", comment: "Splash EnableNotifications") - let secondLabelStringBottom = NSLocalizedString("send you money.", comment: "Splash EnableNotifications") + let secondLabelStringTop = NSLocalizedString("wallet_creation.notifications.title", comment: "WalletCreation view") + let secondLabelStringBottom = NSLocalizedString("wallet_creation.notifications.subtitle", comment: "WalletCreation view") firstLabel.font = Theme.shared.fonts.createWalletNotificationsFirstLabel secondLabel.font = Theme.shared.fonts.createWalletNotificationsSecondLabel firstLabel.text = secondLabelStringTop secondLabel.text = secondLabelStringBottom thirdLabel.font = Theme.shared.fonts.createWalletNotificationsThirdLabel - thirdLabel.text = NSLocalizedString("Enable push notifications to keep tabs on your payments.", comment: "Create Wallet enable Notifications screen") + thirdLabel.text = NSLocalizedString("wallet_creation.notifications.description", comment: "WalletCreation view") - continueButton.setTitle(NSLocalizedString("Turn on Notifications", comment: "Create Wallet Turn on Notifications"), for: .normal) + continueButton.setTitle(NSLocalizedString("wallet_creation.button.turn_on_notifications", comment: "WalletCreation view"), for: .normal) stackViewCenterYConstraint?.constant = -90 stackView.setCustomSpacing(16, after: secondLabel) @@ -696,7 +657,7 @@ extension WalletCreationViewController { button.layer.cornerRadius = 4.0 button.layer.masksToBounds = true button.backgroundColor = Theme.shared.colors.tapToSeeFullEmojiBackground! - button.setTitle(NSLocalizedString("Tap to see full Emoji ID", comment: "Tap to see full Emoji ID in wallet creation"), for: .normal) + button.setTitle(NSLocalizedString("wallet_creation.button.tap_to_see_full_emoji", comment: "WalletCreation view"), for: .normal) button.addTarget(self, action: #selector(tapToSeeButtonAction(_ :)), for: .touchUpInside) button.setTitleColor(Theme.shared.colors.tapToSeeFullEmoji!, for: .normal) button.titleLabel?.font = Theme.shared.fonts.tapToSeeFullEmojiLabel! diff --git a/MobileWallet/Screens/Debug/UIViewControllerDebugExtension.swift b/MobileWallet/Screens/Debug/UIViewControllerDebugExtension.swift index f71b3d7d..742f9236 100644 --- a/MobileWallet/Screens/Debug/UIViewControllerDebugExtension.swift +++ b/MobileWallet/Screens/Debug/UIViewControllerDebugExtension.swift @@ -77,7 +77,7 @@ extension UIViewController: MFMailComposeViewControllerDelegate { UIPasteboard.general.string = "" } catch { UserFeedback.shared.error( - title: NSLocalizedString("Base node error", comment: "Custom base node in clipboard call to action"), + title: NSLocalizedString("Base node error", comment: "Add base node peer error"), description: NSLocalizedString("Failed to set custom base node from clipboard", comment: "Custom base node in clipboard call to action"), error: error ) diff --git a/MobileWallet/Screens/Home/HomeViewController.swift b/MobileWallet/Screens/Home/HomeViewController.swift index 2f76217e..c923275a 100644 --- a/MobileWallet/Screens/Home/HomeViewController.swift +++ b/MobileWallet/Screens/Home/HomeViewController.swift @@ -172,27 +172,27 @@ class HomeViewController: UIViewController { return } - let errorTitle = String(format: NSLocalizedString("Failed to claim %@", comment: "Home view airdrop"), TariSettings.shared.network.currencyDisplayTicker) + let errorTitle = String(format: NSLocalizedString("home.request_drop.error", comment: "Home view"), TariSettings.shared.network.currencyDisplayTicker) do { try keyServer.requestDrop(onSuccess: { () in DispatchQueue.main.asyncAfter(deadline: .now() + 2, execute: { [weak self] in guard let _ = self else { return } - let title = String(format: NSLocalizedString("You just got some %@!", comment: "Home view airdrop"), TariSettings.shared.network.currencyDisplayTicker) - let description = String(format: NSLocalizedString("Try sending a bit of %@ back to Tari Bot. It’s always better to give than to receive (and you’ll see how the wallet works too).", comment: "Home view airdrop"), TariSettings.shared.network.currencyDisplayTicker) + let title = String(format: NSLocalizedString("home.request_drop.title.with_param", comment: "Home view"), TariSettings.shared.network.currencyDisplayTicker) + let description = String(format: NSLocalizedString("home.request_drop.description.with_param", comment: "Home view"), TariSettings.shared.network.currencyDisplayTicker) UserFeedback.shared.callToAction( title: title, description: description, actionTitle: String( format: NSLocalizedString( - "Send %@", - comment: "Home view airdrop" + "common.send.with_param", + comment: "Common" ), TariSettings.shared.network.currencyDisplayTicker ), - cancelTitle: NSLocalizedString("Try it later", comment: "Home view airdrop"), + cancelTitle: NSLocalizedString("home.request_drop.try_later", comment: "Home view"), onAction: { [weak self] in guard let self = self else { return } self.onSend() @@ -236,14 +236,17 @@ class HomeViewController: UIViewController { private func refreshBalance() { guard let wallet = TariLib.shared.tariWallet else { - UserFeedback.shared.error(title: NSLocalizedString("Wallet not initialized", comment: "Home screen"), description: "") + UserFeedback.shared.error( + title: NSLocalizedString("wallet.error.title", comment: "Wallet error"), + description: NSLocalizedString("wallet.error.wallet_not_initialized", comment: "Wallet error") + ) return } let (totalMicroTari, error) = wallet.totalMicroTari guard error == nil else { UserFeedback.shared.error( - title: NSLocalizedString("Balance update failed", comment: "Home screen"), + title: NSLocalizedString("home.error.update_balance", comment: "Home view"), description: "", error: error ) @@ -566,7 +569,7 @@ extension HomeViewController { private func setupBalanceLabel() { view.addSubview(balanceLabel) - balanceLabel.text = NSLocalizedString("Available Balance", comment: "Home screen balance label") + balanceLabel.text = NSLocalizedString("home.available_balance", comment: "Home view") balanceLabel.font = Theme.shared.fonts.homeScreenTotalBalanceLabel balanceLabel.textColor = Theme.shared.colors.homeScreenTotalBalanceLabel @@ -642,7 +645,7 @@ extension HomeViewController { let navigationBarTitle = UILabel() navigationBarContainer.addSubview(navigationBarTitle) - navigationBarTitle.text = NSLocalizedString("Transactions", comment: "Transactions nav bar heading") + navigationBarTitle.text = NSLocalizedString("tx_list.title", comment: "Transactions list") navigationBarTitle.font = Theme.shared.fonts.navigationBarTitle navigationBarTitle.textColor = Theme.shared.colors.transactionsListNavBar @@ -698,8 +701,8 @@ extension HomeViewController { let sendButton = ActionButton() view.addSubview(sendButton) - let title = String(format: NSLocalizedString("Send %@", - comment: "Floating send Tari button on home screen"), + let title = String(format: NSLocalizedString("common.send.with_param", + comment: "Common"), TariSettings.shared.network.currencyDisplayTicker ) sendButton.setTitle(title, for: .normal) sendButton.addTarget(self, action: #selector(onSendAction(_:)), for: .touchUpInside) diff --git a/MobileWallet/Screens/Home/Transaction/TransactionViewController.swift b/MobileWallet/Screens/Home/Transaction/TransactionViewController.swift index 436e52c6..6c6af947 100644 --- a/MobileWallet/Screens/Home/Transaction/TransactionViewController.swift +++ b/MobileWallet/Screens/Home/Transaction/TransactionViewController.swift @@ -197,8 +197,8 @@ class TransactionViewController: UIViewController { try setDetails() } catch { UserFeedback.shared.error( - title: NSLocalizedString("Transaction error", comment: "Transaction detail screen"), - description: NSLocalizedString("Failed to load transaction details", comment: "Transaction detail screen"), + title: NSLocalizedString("transaction_detail.error.load_transaction.title", comment: "Transaction detail view"), + description: NSLocalizedString("transaction_detail.error.load_transaction.description", comment: "Transaction detail view"), error: error ) } @@ -239,8 +239,8 @@ class TransactionViewController: UIViewController { @objc func feeButtonPressed(_ sender: UIButton) { UserFeedback.shared.info( - title: NSLocalizedString("Where does the fee go?", comment: "Transaction detail view"), - description: NSLocalizedString("The transaction fee is distributed to the thousands of computers (also known as “miners”) who ensure that your Tari transactions are fast and secure.", comment: "Transaction detail view") + title: NSLocalizedString("common.fee_info.title", comment: "Common"), + description: NSLocalizedString("common.fee_info.description", comment: "Common") ) } @@ -404,13 +404,13 @@ class TransactionViewController: UIViewController { } if tx.direction == .inbound { - navigationBar.title = NSLocalizedString("Payment Received", comment: "Navigation bar title on transaction view screen") - fromHeadingLabel.text = NSLocalizedString("From", comment: "Transaction detail view") + navigationBar.title = NSLocalizedString("transaction_detail.payment_received", comment: "Transaction detail view") + fromHeadingLabel.text = NSLocalizedString("transaction_detail.from", comment: "Transaction detail view") valueLabel.text = microTari!.formatted contactPublicKey = tx.sourcePublicKey.0 } else if tx.direction == .outbound { - navigationBar.title = NSLocalizedString("Payment Sent", comment: "Navigation bar title on transaction view screen") - fromHeadingLabel.text = NSLocalizedString("To", comment: "Transaction detail view") + navigationBar.title = NSLocalizedString("transaction_detail.payment_sent", comment: "Transaction detail view") + fromHeadingLabel.text = NSLocalizedString("transaction_detail.to", comment: "Transaction detail view") valueLabel.text = microTari!.formatted contactPublicKey = tx.destinationPublicKey.0 } @@ -463,7 +463,7 @@ class TransactionViewController: UIViewController { throw idError! } - let txIdDisplay = NSLocalizedString("Transaction ID:", comment: "Transaction detail view") + " \(String(id))" + let txIdDisplay = NSLocalizedString("transaction_detail.transaction_id", comment: "Transaction detail view") + " \(String(id))" //Get the fee for outbound transactions only if let completedTx = tx as? CompletedTransaction { @@ -485,9 +485,9 @@ class TransactionViewController: UIViewController { } if isCancelled { - navigationBar.title = NSLocalizedString("Payment cancelled", comment: "Navigation bar title on transaction view screen") + navigationBar.title = NSLocalizedString("transaction_detail.payment_cancelled", comment: "Transaction detail view") } else if tx.status.0 != .mined && tx.status.0 != .imported { - navigationBar.title = NSLocalizedString("Payment In Progress", comment: "Navigation bar title on transaction view screen") + navigationBar.title = NSLocalizedString("transaction_detail.payment_in_progress", comment: "Transaction detail view") } //Hopefully we can add this back some time @@ -519,18 +519,18 @@ class TransactionViewController: UIViewController { @objc func onCancelTx() { let alert = UIAlertController( - title: NSLocalizedString("Are you sure?", comment: "TX details view"), - message: NSLocalizedString("You will have to start a new transaction if you change your mind.", comment: "TX details view"), + title: NSLocalizedString("transaction_detail.tx_cancellation.title", comment: "Transaction detail tx cancellation"), + message: NSLocalizedString("transaction_detail.tx_cancellation.message", comment: "Transaction detail tx cancellation"), preferredStyle: .alert ) - alert.addAction(UIAlertAction(title: NSLocalizedString("Yes, cancel", comment: "TX details view"), style: .destructive, handler: { [weak self] (_) in + alert.addAction(UIAlertAction(title: NSLocalizedString("transaction_detail.tx_cancellation.yes", comment: "Transaction detail tx cancellation"), style: .destructive, handler: { [weak self] (_) in guard let self = self else { return } if let tx = self.transaction { guard tx.status.0 == .pending && tx.direction == .outbound else { UserFeedback.shared.error( - title: NSLocalizedString("Failed to cancel transaction", comment: "Tx detail view"), - description: NSLocalizedString("Transaction is no longer in a state where it can be cancelled.", comment: "Tx detail view") + title: NSLocalizedString("transaction_detail.tx_cancellation.error.title", comment: "Transaction detail tx cancellation"), + description: NSLocalizedString("transaction_detail.tx_cancellation.error.description", comment: "Transaction detail tx cancellation") ) return } @@ -550,8 +550,8 @@ class TransactionViewController: UIViewController { // self.updateTxState() // } catch { // UserFeedback.shared.error( -// title: NSLocalizedString("Transaction error", comment: "Transaction detail screen"), -// description: NSLocalizedString("Failed to load transaction details", comment: "Transaction detail screen"), +// title: NSLocalizedString("transaction_detail.error.load_transaction.title", comment: "Transaction detail view"), +// description: NSLocalizedString("transaction_detail.error.load_transaction.description", comment: "Transaction detail view"), // error: error // ) // } @@ -563,14 +563,14 @@ class TransactionViewController: UIViewController { self.navigationController?.popViewController(animated: true) } catch { UserFeedback.shared.error( - title: NSLocalizedString("Failed to cancel transaction", comment: "Tx detail view"), + title: NSLocalizedString("transaction_detail.tx_cancellation.error.title", comment: "Transaction detail tx cancellation"), description: "", error: error ) } } })) - alert.addAction(UIAlertAction(title: NSLocalizedString("Not now", comment: "TX details view"), style: .cancel, handler: nil)) + alert.addAction(UIAlertAction(title: NSLocalizedString("transaction_detail.tx_cancellation.no", comment: "Transaction detail tx cancellation"), style: .cancel, handler: nil)) present(alert, animated: true, completion: nil) } } @@ -601,8 +601,8 @@ extension TransactionViewController: UITextFieldDelegate { guard contactPublicKey != nil else { UserFeedback.shared.error( - title: NSLocalizedString("Contact error", comment: "Transaction detail screen"), - description: NSLocalizedString("Missing public key from transaction.", comment: "Transaction detail screen") + title: NSLocalizedString("transaction_detail.error.contact.title", comment: "Transaction detail view"), + description: NSLocalizedString("transaction_detail.error.contact.description", comment: "Transaction detail view") ) return true } @@ -616,8 +616,8 @@ extension TransactionViewController: UITextFieldDelegate { }) } catch { UserFeedback.shared.error( - title: NSLocalizedString("Contact error", comment: "Transaction detail screen"), - description: NSLocalizedString("Failed to save contact details.", comment: "Transaction detail screen"), + title: NSLocalizedString("transaction_detail.error.contact.title", comment: "Transaction detail view"), + description: NSLocalizedString("transaction_detail.error.save_contact.description", comment: "Transaction detail view"), error: error ) } diff --git a/MobileWallet/Screens/Home/Transaction/TransactionViewControllerExtension.swift b/MobileWallet/Screens/Home/Transaction/TransactionViewControllerExtension.swift index a724cc9a..5bbfabdf 100644 --- a/MobileWallet/Screens/Home/Transaction/TransactionViewControllerExtension.swift +++ b/MobileWallet/Screens/Home/Transaction/TransactionViewControllerExtension.swift @@ -111,7 +111,7 @@ extension TransactionViewController { feeButton.translatesAutoresizingMaskIntoConstraints = false valueContainerView.addSubview(feeButton) - feeButton.setTitle(NSLocalizedString("Transaction Fee", comment: "Transaction view screen"), for: .normal) + feeButton.setTitle(NSLocalizedString("common.fee", comment: "Common"), for: .normal) feeButton.titleLabel?.font = Theme.shared.fonts.transactionFeeButton feeButton.setRightImage(Theme.shared.images.transactionFee!) @@ -151,7 +151,7 @@ extension TransactionViewController { addContactButton.topAnchor.constraint(equalTo: fromHeadingLabel.bottomAnchor, constant: bottomHeadingPadding).isActive = true addContactButton.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -Theme.shared.sizes.appSidePadding).isActive = true - addContactButton.setTitle(NSLocalizedString("Add Contact Name", comment: "Transaction detail view"), for: .normal) + addContactButton.setTitle(NSLocalizedString("transaction_detail.add_contact_name", comment: "Transaction detail view"), for: .normal) addContactButton.setVariation(.secondary) addContactButton.addTarget(self, action: #selector(addContactButtonPressed), for: .touchUpInside) } @@ -161,7 +161,7 @@ extension TransactionViewController { view.addSubview(contactNameHeadingLabel) contactNameHeadingLabel.textColor = Theme.shared.colors.transactionScreenSubheadingLabel contactNameHeadingLabel.font = Theme.shared.fonts.transactionScreenSubheadingLabel - contactNameHeadingLabel.text = NSLocalizedString("Contact Name", comment: "Transaction detail view") + contactNameHeadingLabel.text = NSLocalizedString("transaction_detail.contact_name", comment: "Transaction detail view") contactNameHeadingLabelTopAnchor = contactNameHeadingLabel.topAnchor.constraint(equalTo: fromContainerView.bottomAnchor, constant: headingLabelTopAnchorHeight) contactNameHeadingLabelTopAnchor.isActive = true contactNameHeadingLabel.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: Theme.shared.sizes.appSidePadding).isActive = true @@ -170,7 +170,7 @@ extension TransactionViewController { view.addSubview(contactNameTextField) contactNameTextField.textColor = Theme.shared.colors.transactionScreenTextLabel contactNameTextField.font = Theme.shared.fonts.transactionScreenTextLabel - contactNameTextField.placeholder = NSLocalizedString("Create a Contact Name", comment: "Transaction detail view") + contactNameTextField.placeholder = NSLocalizedString("transaction_detail.contect_name_placeholder", comment: "Transaction detail view") contactNameTextField.autocorrectionType = .no contactNameTextField.returnKeyType = .done contactNameTextField.delegate = self @@ -183,7 +183,7 @@ extension TransactionViewController { view.addSubview(editContactNameButton) editContactNameButton.topAnchor.constraint(equalTo: contactNameHeadingLabel.bottomAnchor, constant: bottomHeadingPadding).isActive = true editContactNameButton.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -Theme.shared.sizes.appSidePadding).isActive = true - editContactNameButton.setTitle(NSLocalizedString("Edit", comment: "Transaction detail view"), for: .normal) + editContactNameButton.setTitle(NSLocalizedString("transaction_detail.edit", comment: "Transaction detail view"), for: .normal) editContactNameButton.setVariation(.secondary) editContactNameButton.addTarget(self, action: #selector(editContactButtonPressed), for: .touchUpInside) } @@ -204,7 +204,7 @@ extension TransactionViewController { view.addSubview(noteHeadingLabel) noteHeadingLabel.textColor = Theme.shared.colors.transactionScreenSubheadingLabel noteHeadingLabel.font = Theme.shared.fonts.transactionScreenSubheadingLabel - noteHeadingLabel.text = NSLocalizedString("Note", comment: "Transaction detail view") + noteHeadingLabel.text = NSLocalizedString("transaction_detail.note", comment: "Transaction detail view") noteHeadingLabelTopAnchorConstraintContactNameShowing = noteHeadingLabel.topAnchor.constraint( equalTo: dividerView.bottomAnchor, constant: Theme.shared.sizes.appSidePadding @@ -252,7 +252,7 @@ extension TransactionViewController { cancelButton.topAnchor.constraint(equalTo: txStateView.bottomAnchor, constant: 0).isActive = true cancelButton.centerXAnchor.constraint(equalTo: navigationBar.centerXAnchor).isActive = true - cancelButton.setTitle(NSLocalizedString("Cancel Transaction", comment: "Tx detail view"), for: .normal) + cancelButton.setTitle(NSLocalizedString("transaction_detail.tx_cancellation.cancel", comment: "Transaction detail tx cancellation"), for: .normal) cancelButton.setVariation(.warning, font: Theme.shared.fonts.textButtonCancel) cancelButton.addTarget(self, action: #selector(onCancelTx), for: .touchUpInside) } diff --git a/MobileWallet/Screens/Home/TransactionHistory/TransactionsTableViewController.swift b/MobileWallet/Screens/Home/TransactionHistory/TransactionsTableViewController.swift index d457bf10..4970cb44 100644 --- a/MobileWallet/Screens/Home/TransactionHistory/TransactionsTableViewController.swift +++ b/MobileWallet/Screens/Home/TransactionHistory/TransactionsTableViewController.swift @@ -106,7 +106,7 @@ class TransactionsTableViewController: UITableViewController { return animationContainer }() - let pendingLabelText = NSLocalizedString("In Progress", comment: "Home view table of transactions") + let pendingLabelText = NSLocalizedString("tx_list.in_progress", comment: "Transactions list") override func viewDidLoad() { super.viewDidLoad() @@ -183,8 +183,8 @@ class TransactionsTableViewController: UITableViewController { } } catch { UserFeedback.shared.error( - title: NSLocalizedString("Base node error", comment: "Refreshing TX list view"), - description: NSLocalizedString("Could not sync to base node", comment: "Refreshing TX list view"), + title: NSLocalizedString("tx_list.error.sync_to_base_node.title", comment: "Transactions list"), + description: NSLocalizedString("tx_list.error.sync_to_base_node.description", comment: "Transactions list"), error: error ) } @@ -211,7 +211,7 @@ class TransactionsTableViewController: UITableViewController { func refreshTable() { guard let wallet = TariLib.shared.tariWallet else { UserFeedback.shared.error( - title: NSLocalizedString("Failed to access wallet", comment: "Home screen"), + title: NSLocalizedString("wallet.error.failed_to_access", comment: "Wallet error"), description: "" ) return @@ -221,8 +221,8 @@ class TransactionsTableViewController: UITableViewController { let (groupedTransactions, groupedTransactionsError) = wallet.groupedCompletedAndCancelledTransactions guard groupedTransactionsError == nil else { UserFeedback.shared.error( - title: NSLocalizedString("Failed to load transactions", comment: "Home screen"), - description: NSLocalizedString("Could not load grouped completed transactions", comment: "Home screen"), + title: NSLocalizedString("tx_list.error.grouped_transactions.title", comment: "Transactions list"), + description: NSLocalizedString("tx_list.error.grouped_transactions.descritpion", comment: "Transactions list"), error: groupedTransactionsError ) return @@ -232,8 +232,8 @@ class TransactionsTableViewController: UITableViewController { let (pendingInboundTxs, pendingInboundTxsError) = wallet.pendingInboundTransactions guard pendingInboundTxsError == nil else { UserFeedback.shared.error( - title: NSLocalizedString("Failed to load transactions", comment: "Home screen"), - description: NSLocalizedString("Could not load pending inbound transactions", comment: "Home screen"), + title: NSLocalizedString("tx_list.error.grouped_transactions.title", comment: "Transactions list"), + description: NSLocalizedString("tx_list.error.pending_inbound_tx.description", comment: "Transactions list"), error: pendingInboundTxsError ) return @@ -242,8 +242,8 @@ class TransactionsTableViewController: UITableViewController { let (pendingInboundTxsList, pendingInboundTxsListError) = pendingInboundTxs!.list guard pendingInboundTxsListError == nil else { UserFeedback.shared.error( - title: NSLocalizedString("Failed to load transactions", comment: "Home screen"), - description: NSLocalizedString("Could not load list of pending inbound transactions", comment: "Home screen"), + title: NSLocalizedString("tx_list.error.grouped_transactions.title", comment: "Transactions list"), + description: NSLocalizedString("tx_list.error.pending_inbound_tx.title", comment: "Transactions list"), error: pendingInboundTxsListError ) return @@ -253,8 +253,8 @@ class TransactionsTableViewController: UITableViewController { let (pendingOutboundTxs, pendingOutboundTxsError) = wallet.pendingOutboundTransactions guard pendingOutboundTxsError == nil else { UserFeedback.shared.error( - title: NSLocalizedString("Failed to load transactions", comment: "Home screen"), - description: NSLocalizedString("Could not load pending outbound transactions", comment: "Home screen"), + title: NSLocalizedString("tx_list.error.grouped_transactions.title", comment: "Transactions list"), + description: NSLocalizedString("tx_list.error.pending_outbound_tx..description", comment: "Transactions list"), error: pendingOutboundTxsError ) return @@ -263,8 +263,8 @@ class TransactionsTableViewController: UITableViewController { let (pendingOutboundTxsList, pendingOutboundTxsListError) = pendingOutboundTxs!.list guard pendingOutboundTxsListError == nil else { UserFeedback.shared.error( - title: NSLocalizedString("Failed to load transactions", comment: "Home screen"), - description: NSLocalizedString("Could not load list of pending outbound transactions", comment: "Home screen"), + title: NSLocalizedString("tx_list.error.grouped_transactions.title", comment: "Transactions list"), + description: NSLocalizedString("tx_list.error.pending_outbound_tx.title", comment: "Transactions list"), error: pendingOutboundTxsListError ) return diff --git a/MobileWallet/Screens/Home/TransactionHistory/TransactionsTableViewControllerExtension.swift b/MobileWallet/Screens/Home/TransactionHistory/TransactionsTableViewControllerExtension.swift index 136c6649..80596e6d 100644 --- a/MobileWallet/Screens/Home/TransactionHistory/TransactionsTableViewControllerExtension.swift +++ b/MobileWallet/Screens/Home/TransactionHistory/TransactionsTableViewControllerExtension.swift @@ -158,7 +158,7 @@ extension TransactionsTableViewController { emptyView.addSubview(messageLabel) messageLabel.numberOfLines = 0 - messageLabel.text = NSLocalizedString("We don’t see any transactions yet.\nHopefully something happens soon…🤞 ", comment: "Home view table when there are no transactions") + messageLabel.text = NSLocalizedString("tx_list.empty", comment: "Home view table when there are no transactions") messageLabel.textAlignment = .center messageLabel.textColor = Theme.shared.colors.transactionSmallSubheadingLabel messageLabel.font = Theme.shared.fonts.transactionListEmptyMessageLabel @@ -185,7 +185,7 @@ extension TransactionsTableViewController { titleLabel.translatesAutoresizingMaskIntoConstraints = false introView.addSubview(titleLabel) - let titleText = NSLocalizedString("Your wallet setup is complete.", comment: "Home screen untro") + let titleText = NSLocalizedString("tx_list.intro", comment: "Home screen untro") let attributedTitle = NSMutableAttributedString( string: titleText, @@ -203,7 +203,7 @@ extension TransactionsTableViewController { messageLabel.translatesAutoresizingMaskIntoConstraints = false introView.addSubview(messageLabel) - messageLabel.text = NSLocalizedString("You’re ready to start exploring", comment: "Home view table on introdution to wallet") + messageLabel.text = NSLocalizedString("tx_list.intro_message", comment: "Home view table on introdution to wallet") messageLabel.textAlignment = .center messageLabel.textColor = Theme.shared.colors.transactionSmallSubheadingLabel messageLabel.font = Theme.shared.fonts.transactionListEmptyMessageLabel diff --git a/MobileWallet/Screens/Profile/ProfileViewController.swift b/MobileWallet/Screens/Profile/ProfileViewController.swift index 47636f06..0182a9ac 100644 --- a/MobileWallet/Screens/Profile/ProfileViewController.swift +++ b/MobileWallet/Screens/Profile/ProfileViewController.swift @@ -74,7 +74,7 @@ class ProfileViewController: UIViewController { // MARK: - Private functions private func setupNavigationBar() { - navigationBar.title = NSLocalizedString("My Profile", comment: "ProfileViewController title") + navigationBar.title = NSLocalizedString("profile_view.title", comment: "Profile view") navigationBar.backgroundColor = Theme.shared.colors.profileBackground navigationBar.rightButtonAction = { [weak self] in @@ -151,7 +151,7 @@ class ProfileViewController: UIViewController { private func customizeMiddleLabel() { let middleLabelText = String( format: NSLocalizedString( - "Transacting in person? Others can scan this QR code from the Tari Aurora App to send you %@.", + "profile_view.error.qr_code.description.with_param", comment: "Profile view" ), TariSettings.shared.network.currencyDisplayTicker @@ -201,7 +201,7 @@ class ProfileViewController: UIViewController { try genQRCode() } catch { UserFeedback.shared.error( - title: NSLocalizedString("Failed to generate QR", comment: "Profile view"), + title: NSLocalizedString("profile_view.error.qr_code.title", comment: "Profile view"), description: "", error: error) } diff --git a/MobileWallet/Screens/RestoreWallet/RestoreWalletPendingView.swift b/MobileWallet/Screens/RestoreWallet/RestoreWalletPendingView.swift index cc1ea587..2b7e271b 100644 --- a/MobileWallet/Screens/RestoreWallet/RestoreWalletPendingView.swift +++ b/MobileWallet/Screens/RestoreWallet/RestoreWalletPendingView.swift @@ -111,7 +111,7 @@ class RestoreWalletPendingView: UIView { private func setupTitle() { let title = UILabel() - title.text = NSLocalizedString("Restoring your wallet", comment: "restore pending title") + title.text = NSLocalizedString("restore_pending_view.title", comment: "RestorePending view") title.font = Theme.shared.fonts.restorePendingViewTitle title.textColor = Theme.shared.colors.restorePendingViewTitle @@ -124,7 +124,7 @@ class RestoreWalletPendingView: UIView { description.numberOfLines = 0 description.textAlignment = .center - description.text = NSLocalizedString("This could take between 1 to 3 minutes.\nPlease keep the app open.", comment: "restore pending description") + description.text = NSLocalizedString("restore_pending_view.description", comment: "RestorePending view") description.font = Theme.shared.fonts.restorePendingViewDescription description.textColor = Theme.shared.colors.restorePendingViewDescription diff --git a/MobileWallet/Screens/RestoreWallet/RestoreWalletViewController.swift b/MobileWallet/Screens/RestoreWallet/RestoreWalletViewController.swift index 32060403..cc679422 100644 --- a/MobileWallet/Screens/RestoreWallet/RestoreWalletViewController.swift +++ b/MobileWallet/Screens/RestoreWallet/RestoreWalletViewController.swift @@ -54,8 +54,8 @@ class RestoreWalletViewController: UIViewController { var rawValue: String { switch self { - case .iCloudRestore: return NSLocalizedString("Restore with iCloud", comment: "RestoreCellTitle") - case .phraseRestore: return NSLocalizedString("Restore with recovery phrase", comment: "RestoreCellTitle") + case .iCloudRestore: return NSLocalizedString("restore_wallet.item.iCloud_restore", comment: "RestoreWallet view") + case .phraseRestore: return NSLocalizedString("restore_wallet.item.phrase_restore", comment: "RestoreWallet view") } } } @@ -103,7 +103,7 @@ extension RestoreWalletViewController: UITableViewDelegate, UITableViewDataSourc ICloudBackup.shared.restoreWallet(completion: { [weak self] error in if error != nil { - UserFeedback.shared.error(title: NSLocalizedString("Failed to restore wallet", comment: "Restore wallet failture"), description: "", error: error) { [weak self] in + UserFeedback.shared.error(title: NSLocalizedString("iCloud_backup.error.restore_wallet.title", comment: "RestoreWallet view"), description: "", error: error) { [weak self] in self?.pendingView.hidePendingView() } return @@ -137,7 +137,7 @@ extension RestoreWalletViewController { } private func setupNavigationBar() { - navigationBar.title = NSLocalizedString("Restore Your Wallet", comment: "RestoreWalletViewController title") + navigationBar.title = NSLocalizedString("restore_wallet.title", comment: "RestoreWallet view") view.addSubview(navigationBar) navigationBar.translatesAutoresizingMaskIntoConstraints = false diff --git a/MobileWallet/Screens/Send/AddAmount/AddAmountViewController.swift b/MobileWallet/Screens/Send/AddAmount/AddAmountViewController.swift index 48a37edb..c51e9e1b 100644 --- a/MobileWallet/Screens/Send/AddAmount/AddAmountViewController.swift +++ b/MobileWallet/Screens/Send/AddAmount/AddAmountViewController.swift @@ -102,8 +102,8 @@ class AddAmountViewController: UIViewController { try navigationBar.showEmoji(pubKey, animated: true) } catch { UserFeedback.shared.error( - title: NSLocalizedString("Public key error", comment: "Add amount view"), - description: NSLocalizedString("Failed to get Emoji ID from user's contact", comment: "Add amount view"), + title: NSLocalizedString("navigation_bar.error.show_emoji.title", comment: "Navigation bar"), + description: NSLocalizedString("navigation_bar.error.show_emoji.description", comment: "Navigation bar"), error: error ) } @@ -139,8 +139,8 @@ class AddAmountViewController: UIViewController { let (totalMicroTari, totalMicroTariError) = wallet.totalMicroTari guard totalMicroTariError == nil else { UserFeedback.shared.error( - title: NSLocalizedString("Available Balance error", comment: "Amount screen"), - description: NSLocalizedString("Failed to get the available balance.", comment: "Amount screen"), + title: NSLocalizedString("add_amount.error.available_balance.title", comment: "Add amount view"), + description: NSLocalizedString("add_amount.error.available_balance.description", comment: "Add amount view"), error: totalMicroTariError ) return @@ -177,7 +177,7 @@ class AddAmountViewController: UIViewController { //Shouldn't ever really be used but just in case private func showInvalidNumberError(_ error: Error?) { UserFeedback.shared.error( - title: NSLocalizedString("Invalid number", comment: "Add amount screen"), + title: NSLocalizedString("add_amount.error.invalid_number", comment: "Add amount view"), description: "", error: error ) @@ -304,8 +304,8 @@ class AddAmountViewController: UIViewController { @objc private func feeButtonPressed(_ sender: UIButton) { UserFeedback.shared.info( - title: NSLocalizedString("Where does the fee go?", comment: "Transaction detail view"), - description: NSLocalizedString("The transaction fee is distributed to the thousands of computers (also known as “miners”) who ensure that your Tari transactions are fast and secure.", comment: "Transaction detail view")) + title: NSLocalizedString("common.fee_info.title", comment: "Common"), + description: NSLocalizedString("common.fee_info.description", comment: "Common")) } private func showBalanceExceeded(balance: String) { @@ -361,8 +361,8 @@ class AddAmountViewController: UIViewController { let (availableBalance, availableBalanceError) = wallet.availableBalance guard availableBalanceError == nil else { UserFeedback.shared.error( - title: NSLocalizedString("Available balance error", comment: "Add amount view"), - description: NSLocalizedString("Could not get available balance from wallet", comment: "Add amount view"), + title: NSLocalizedString("add_amount.error.available_balance.title", comment: "Add amount view"), + description: NSLocalizedString("add_amount.error.available_balance.description", comment: "Add amount view"), error: availableBalanceError ) return @@ -378,8 +378,8 @@ class AddAmountViewController: UIViewController { guard let amount = tariAmount else { return } if amount.rawValue + wallet.calculateTransactionFee(amount).rawValue > availableBalance { UserFeedback.shared.info( - title: NSLocalizedString("Hold your horses! 🐴", comment: "Add amount view"), - description: NSLocalizedString("Sorry, you can’t send this much Tari until your previous transaction(s) are complete. Please wait for at least one transaction to complete and then try again.", comment: "Add amount view") + title: NSLocalizedString("add_amount.info.wait_completion_previous_tx.title", comment: "Add amount view"), + description: NSLocalizedString("add_amount.info.wait_completion_previous_tx.descrption", comment: "Add amount view") ) return } @@ -411,7 +411,7 @@ extension AddAmountViewController { continueButton.leftAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leftAnchor, constant: 25).isActive = true continueButton.rightAnchor.constraint(equalTo: view.safeAreaLayoutGuide.rightAnchor, constant: -25).isActive = true continueButton.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -10).isActive = true - continueButton.setTitle(NSLocalizedString("Continue", comment: "Continue button on the amount screen"), for: .normal) + continueButton.setTitle(NSLocalizedString("common.continue", comment: "Common"), for: .normal) continueButton.addTarget(self, action: #selector(continueButtonTapped), for: .touchUpInside) continueButton.isEnabled = false setupKeypad() @@ -478,7 +478,7 @@ extension AddAmountViewController { warningStackView.addArrangedSubview(warningLabel) warningLabel.font = Theme.shared.fonts.amountWarningLabel warningLabel.textColor = Theme.shared.colors.amountWarningLabel - warningLabel.text = NSLocalizedString("Not enough Tari in your available balance", comment: "Balance amount error") + warningLabel.text = NSLocalizedString("add_amount.warning.not_enough_tari", comment: "Add amount view") warningLabel.textAlignment = .center warningLabel.heightAnchor.constraint(equalToConstant: warningLabel.font.pointSize * 1.2).isActive = true @@ -504,7 +504,7 @@ extension AddAmountViewController { let feeButton = TextButton() feeButton.translatesAutoresizingMaskIntoConstraints = false - feeButton.setTitle(NSLocalizedString("Transaction Fee", comment: "Transaction view screen"), for: .normal) + feeButton.setTitle(NSLocalizedString("common.fee", comment: "Common"), for: .normal) feeButton.setRightImage(Theme.shared.images.transactionFee!) feeButton.addTarget(self, action: #selector(feeButtonPressed), for: .touchUpInside) continueButton.variation = .disabled diff --git a/MobileWallet/Screens/Send/AddNote/AddNoteViewController.swift b/MobileWallet/Screens/Send/AddNote/AddNoteViewController.swift index 025f6a8c..6d9a59ef 100644 --- a/MobileWallet/Screens/Send/AddNote/AddNoteViewController.swift +++ b/MobileWallet/Screens/Send/AddNote/AddNoteViewController.swift @@ -90,8 +90,8 @@ class AddNoteViewController: UIViewController, UITextViewDelegate, SlideViewDele try navigationBar.showEmoji(pubKey, animated: true) } catch { UserFeedback.shared.error( - title: NSLocalizedString("Public key error", comment: "Add amount view"), - description: NSLocalizedString("Failed to get Emoji ID from user's contact", comment: "Add amount view"), + title: NSLocalizedString("navigation_bar.error.show_emoji.title", comment: "Navigation bar"), + description: NSLocalizedString("navigation_bar.error.show_emoji.description", comment: "Navigation bar"), error: error ) } @@ -185,8 +185,8 @@ class AddNoteViewController: UIViewController, UITextViewDelegate, SlideViewDele guard let wallet = TariLib.shared.tariWallet else { UserFeedback.shared.error( - title: NSLocalizedString("Wallet error", comment: "Add note view"), - description: NSLocalizedString("Wallet not initialized", comment: "Add note view") + title: NSLocalizedString("wallet.error.title", comment: "Wallet error"), + description: NSLocalizedString("wallet.error.wallet_not_initialized", comment: "Wallet error") ) sender.resetStateWithAnimation(true) return @@ -194,8 +194,8 @@ class AddNoteViewController: UIViewController, UITextViewDelegate, SlideViewDele guard let recipientPublicKey = publicKey else { UserFeedback.shared.error( - title: NSLocalizedString("Missing public key", comment: "Add note view"), - description: NSLocalizedString("Recipient public key not set", comment: "Add note view") + title: NSLocalizedString("add_note.error.recipient_public_key.title", comment: "Add note view"), + description: NSLocalizedString("add_note.error.recipient_public_key.description", comment: "Add note view") ) sender.resetStateWithAnimation(true) return @@ -203,8 +203,8 @@ class AddNoteViewController: UIViewController, UITextViewDelegate, SlideViewDele guard let recipientAmount = amount else { UserFeedback.shared.error( - title: NSLocalizedString("Missing amount", comment: "Add note view"), - description: NSLocalizedString("Recipient amount not set", comment: "Add note view") + title: NSLocalizedString("add_note.error.recipient_amount.title", comment: "Add note view"), + description: NSLocalizedString("add_note.error.recipient_amount.description", comment: "Add note view") ) sender.resetStateWithAnimation(true) return @@ -248,7 +248,7 @@ extension AddNoteViewController { titleLabel.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: SIDE_PADDING).isActive = true titleLabel.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -SIDE_PADDING).isActive = true titleLabel.heightAnchor.constraint(equalToConstant: titleLabel.font.pointSize * 1.1).isActive = true - titleLabel.text = NSLocalizedString("Transaction Note", comment: "Add note view") + titleLabel.text = NSLocalizedString("add_note.title", comment: "Add note view") } fileprivate func setupSendButton() { @@ -262,7 +262,7 @@ extension AddNoteViewController { sendButtonBottomConstraint.isActive = true sendButton.showSliderText = true - sendButton.labelText = NSLocalizedString("Slide to Send", comment: "Add note view") + sendButton.labelText = NSLocalizedString("add_note.slide_to_send", comment: "Add note view") sendButton.delegate = self //If we're in testmode, the slide to send doesn't seem to work so allow it to be tapped in this case @@ -304,7 +304,7 @@ extension AddNoteViewController { notePlaceholder.numberOfLines = 0 notePlaceholder.attributedText = NSAttributedString( - string: NSLocalizedString("Let the recipient know what the payment is for", comment: "Add note view"), + string: NSLocalizedString("add_note.placeholder", comment: "Add note view"), attributes: [ NSAttributedString.Key.paragraphStyle: paragraphStyle, NSAttributedString.Key.font: font, diff --git a/MobileWallet/Screens/Send/AddRecipient/AddRecipientViewController.swift b/MobileWallet/Screens/Send/AddRecipient/AddRecipientViewController.swift index ff71fa82..d340cbcb 100644 --- a/MobileWallet/Screens/Send/AddRecipient/AddRecipientViewController.swift +++ b/MobileWallet/Screens/Send/AddRecipient/AddRecipientViewController.swift @@ -77,7 +77,7 @@ class AddRecipientViewController: UIViewController, UITextFieldDelegate, Contact guard pubKey.hex.0 != TariLib.shared.tariWallet?.publicKey.0?.hex.0 else { errorMessageView.message = String( format: NSLocalizedString( - "Sorry, you cannot send %@ to yourself", + "add_recipient.warning.can_not_send_yourself.with_param", comment: "Add recipient view" ), TariSettings.shared.network.currencyDisplayTicker @@ -135,8 +135,8 @@ class AddRecipientViewController: UIViewController, UITextFieldDelegate, Contact self.setInputText(publicKey: pubKey) } catch { UserFeedback.shared.error( - title: NSLocalizedString("Could not use Emoji ID", comment: "Add recipient screen"), - description: "Failed to create a valid contact from the pasted Emoji ID", + title: NSLocalizedString("add_recipient.error.invalid_emoji.title", comment: "Add recipient view"), + description: NSLocalizedString("add_recipient.error.invalid_emoji.description", comment: "Add recipient view"), error: error) } @@ -228,7 +228,7 @@ class AddRecipientViewController: UIViewController, UITextFieldDelegate, Contact if selectedRecipientPublicKey != nil && selectedRecipientPublicKey?.hex.0 != TariLib.shared.tariWallet?.publicKey.0?.hex.0 { onContinue() } else if contactsTableVC.isEmptyList() { - errorMessageView.message = NSLocalizedString("Invalid Emoji ID", comment: "Add recipient view") + errorMessageView.message = NSLocalizedString("add_recipient.inputbox.warning", comment: "Add recipient view") } dismissKeyboard() @@ -273,7 +273,7 @@ class AddRecipientViewController: UIViewController, UITextFieldDelegate, Contact } private func setupNavigationBar() { - navigationBar.title = NSLocalizedString("Send To", comment: "Navigation bar title on send view screen") + navigationBar.title = NSLocalizedString("add_recipient.title", comment: "Add recipient view") navigationBar.translatesAutoresizingMaskIntoConstraints = false view.addSubview(navigationBar) navigationBar.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor).isActive = true @@ -311,7 +311,7 @@ class AddRecipientViewController: UIViewController, UITextFieldDelegate, Contact inputBox.heightAnchor.constraint(equalToConstant: emojiIdHeight).isActive = true //Input style - inputBox.placeholder = NSLocalizedString("Enter Emoji ID or Contact Name", comment: "Add recipient view") + inputBox.placeholder = NSLocalizedString("add_recipient.inputbox.placeholder", comment: "Add recipient view") inputBox.backgroundColor = Theme.shared.colors.appBackground inputBox.font = Theme.shared.fonts.searchContactsInputBoxText inputBox.leftView = UIView(frame: CGRect(x: 0, y: 0, width: sidePadding / 2, height: inputBox.frame.height)) @@ -341,7 +341,7 @@ class AddRecipientViewController: UIViewController, UITextFieldDelegate, Contact } private func setupContinueButton() { - continueButton.setTitle(NSLocalizedString("Continue", comment: "Add recipient view"), for: .normal) + continueButton.setTitle(NSLocalizedString("common.continue", comment: "Common"), for: .normal) view.addSubview(continueButton) continueButton.translatesAutoresizingMaskIntoConstraints = false diff --git a/MobileWallet/Screens/Send/AddRecipient/ContactsTableViewController.swift b/MobileWallet/Screens/Send/AddRecipient/ContactsTableViewController.swift index fe12a4c3..bf770040 100644 --- a/MobileWallet/Screens/Send/AddRecipient/ContactsTableViewController.swift +++ b/MobileWallet/Screens/Send/AddRecipient/ContactsTableViewController.swift @@ -128,8 +128,8 @@ class ContactsTableViewController: UITableViewController { try self?.loadContacts() } catch { UserFeedback.shared.error( - title: NSLocalizedString("Failed to load contacts", comment: "Add recipient view"), - description: NSLocalizedString("Could not access wallet", comment: "Add recipient view"), + title: NSLocalizedString("add_recipient.error.load_contacts.title", comment: "Add recipient view"), + description: NSLocalizedString("add_recipient.error.load_contacts.description", comment: "Add recipient view"), error: error ) } @@ -225,10 +225,10 @@ class ContactsTableViewController: UITableViewController { override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { if section == 0 { - return NSLocalizedString("Recent Transactions", comment: "Add recipient view") + return NSLocalizedString("add_recipient.recent_transactions", comment: "Add recipient view") } - return NSLocalizedString("My Contacts", comment: "Add recipient view") + return NSLocalizedString("add_recipient.my_contacts", comment: "Add recipient view") } override func tableView(_ tableView: UITableView, willSelectRowAt indexPath: IndexPath) -> IndexPath? { diff --git a/MobileWallet/Screens/Send/AddRecipient/PasteEmojisView.swift b/MobileWallet/Screens/Send/AddRecipient/PasteEmojisView.swift index c07bb8aa..d3dc0394 100644 --- a/MobileWallet/Screens/Send/AddRecipient/PasteEmojisView.swift +++ b/MobileWallet/Screens/Send/AddRecipient/PasteEmojisView.swift @@ -67,7 +67,7 @@ class PasteEmojisView: UIView { } func setEmojis(emojis: String, onPress: @escaping () -> Void) { - textButton.setTitle(NSLocalizedString("Paste copied Emoji ID", comment: ""), for: .normal) + textButton.setTitle(NSLocalizedString("emoji.paste", comment: "Emoji view"), for: .normal) let first = "\(emojis.prefix(6))".insertSeparator(" | ", atEvery: 3) let last = "\(emojis.suffix(6))".insertSeparator(" | ", atEvery: 3) emojiLabel.text = "\(first)...\(last)" diff --git a/MobileWallet/Screens/Send/AddRecipient/ScanViewController.swift b/MobileWallet/Screens/Send/AddRecipient/ScanViewController.swift index 375ec81b..052a90ac 100644 --- a/MobileWallet/Screens/Send/AddRecipient/ScanViewController.swift +++ b/MobileWallet/Screens/Send/AddRecipient/ScanViewController.swift @@ -221,8 +221,8 @@ class ScanViewController: UIViewController { private func customizeViews() { self.titleLabel.text = String( format: NSLocalizedString( - "Scan a Tari QR code to send %@ to the recipient.", - comment: "Scan contact camera view" + "scan_view.scan_qr_to_send.with_param", + comment: "Scan view" ), TariSettings.shared.network.currencyDisplayTicker ) @@ -317,8 +317,8 @@ class ScanViewController: UIViewController { UINotificationFeedbackGenerator().notificationOccurred(.success) } catch { UserFeedback.shared.error( - title: NSLocalizedString("Scanning error", comment: "Scanner view"), - description: NSLocalizedString("Failed to import user's public key", comment: "Scanner view"), + title: NSLocalizedString("scan_view.error.title", comment: "Scan view"), + description: NSLocalizedString("scan_view.error.description", comment: "Scan view"), error: error ) } diff --git a/MobileWallet/Screens/Send/SendingTari/SendingTariViewController.swift b/MobileWallet/Screens/Send/SendingTari/SendingTariViewController.swift index f8fd9e6a..fcdf1242 100644 --- a/MobileWallet/Screens/Send/SendingTari/SendingTariViewController.swift +++ b/MobileWallet/Screens/Send/SendingTari/SendingTariViewController.swift @@ -66,18 +66,18 @@ class SendingTariViewController: UIViewController { return ("", "") case .connectionCheck: return ( - NSLocalizedString("Connecting to the", comment: ""), - NSLocalizedString("Tari Network...", comment: "") + NSLocalizedString("sending_tari.connecting", comment: "SendingTari view"), + NSLocalizedString("sending_tari.network", comment: "SendingTari view") ) case .discovery: return ( - NSLocalizedString("Searching for the", comment: ""), - NSLocalizedString("recipient on the Tari Network...", comment: "") + NSLocalizedString("sending_tari.searching", comment: "SendingTari view"), + NSLocalizedString("sending_tari.recipient", comment: "SendingTari view") ) case .sent: return ( - NSLocalizedString("Good to go!", comment: ""), - NSLocalizedString("Your transaction is on its way...", comment: "") + NSLocalizedString("sending_tari.sent", comment: "SendingTari view"), + NSLocalizedString("sending_tari.transaction_is_on_its_way", comment: "SendingTari view") ) } } @@ -750,12 +750,12 @@ class SendingTariViewController: UIViewController { case .internetConnectionError: UserFeedback.shared.error( title: NSLocalizedString( - "Can't connect to the interwebs", - comment: "Internet connection error when sending a tx" + "sending_tari.error.interwebs_connection.title", + comment: "SendingTari view" ), description: NSLocalizedString( - "Your phone is either offline or has a poor connection at the moment. We'll wait here until you find some stronger signal.", - comment: "Internet connection error when sending a tx" + "sending_tari.error.interwebs_connection.description", + comment: "SendingTari view" ) ) Tracker.shared.track( @@ -765,12 +765,12 @@ class SendingTariViewController: UIViewController { case .networkConnectionTimeout, .sendError: UserFeedback.shared.error( title: NSLocalizedString( - "It's not you, it's the network.", - comment: "Tari network connection error when sending a tx" + "sending_tari.error.no_connection.title", + comment: "SendingTari view" ), description: NSLocalizedString( - "Looks like there's a connectivity issue on our end. Can you give us a few min, then come back and try again?", - comment: "Tari network connection error when sending a tx" + "sending_tari.error.no_connection.description", + comment: "SendingTari view" ) ) Tracker.shared.track( diff --git a/MobileWallet/Screens/Settings/BackUpSettings/BackupWalletSettingsViewController.swift b/MobileWallet/Screens/Settings/BackUpSettings/BackupWalletSettingsViewController.swift index e1a15e9d..ee227419 100644 --- a/MobileWallet/Screens/Settings/BackUpSettings/BackupWalletSettingsViewController.swift +++ b/MobileWallet/Screens/Settings/BackUpSettings/BackupWalletSettingsViewController.swift @@ -62,8 +62,8 @@ class BackupWalletSettingsViewController: SettingsParentTableViewController { var rawValue: String { switch self { - case .backUpToiCloud: return NSLocalizedString("Back up to iCloud", comment: "BackupWalletSettingsItem") - case .backUpWithRecoveryPhrase: return NSLocalizedString("Back up with recovery phrase", comment: "BackupWalletSettingsItem") + case .backUpToiCloud: return NSLocalizedString("backup_wallet_settings.item.to_icloud", comment: "BackupWalletSettings view") + case .backUpWithRecoveryPhrase: return NSLocalizedString("backup_wallet_settings.item.with_recovery_phrase", comment: "BackupWalletSettings view") } } } @@ -88,7 +88,7 @@ class BackupWalletSettingsViewController: SettingsParentTableViewController { try self?.iCloudBackup.createWalletBackup() self?.iCloudBackupItem.mark = .progress } catch { - UserFeedback.shared.error(title: NSLocalizedString("Failed to create backup", comment: "Backup wallet settings"), description: "", error: error) + UserFeedback.shared.error(title: NSLocalizedString("iCloud_backup.error.title", comment: "iCloudBackup error"), description: "", error: error) self?.iCloudBackupItem.mark = .attention } } @@ -112,7 +112,7 @@ class BackupWalletSettingsViewController: SettingsParentTableViewController { extension BackupWalletSettingsViewController: ICloudBackupObserver { func onUploadProgress(percent: Double, completed: Bool, error: Error?) { if error != nil { - UserFeedback.shared.error(title: NSLocalizedString("Failed to create backup", comment: "Backup wallet settings"), description: "", error: error) + UserFeedback.shared.error(title: NSLocalizedString("iCloud_backup.error.title", comment: "iCloudBackup error"), description: "", error: error) iCloudBackupItem.mark = .attention return } @@ -152,7 +152,7 @@ extension BackupWalletSettingsViewController: UITableViewDelegate, UITableViewDa let label = UILabel() label.font = Theme.shared.fonts.settingsTableViewHeader - label.text = NSLocalizedString("Back Up Wallet", comment: "Back Up Waallet header") + label.text = NSLocalizedString("backup_wallet_settings.header.title", comment: "BackupWalletSettings view") header.addSubview(label) @@ -164,7 +164,7 @@ extension BackupWalletSettingsViewController: UITableViewDelegate, UITableViewDa desctiptionLabel.numberOfLines = 0 desctiptionLabel.font = Theme.shared.fonts.settingsSeedPhraseDescription desctiptionLabel.textColor = Theme.shared.colors.settingsSeedPhraseDescription - desctiptionLabel.text = NSLocalizedString("By backing up your wallet, you’ll ensure that you don’t lose your tXTR if your phone is lost or broken.", comment: "Back Up Waallet header description") + desctiptionLabel.text = NSLocalizedString("backup_wallet_settings.header.description", comment: "BackupWalletSettings view") header.addSubview(desctiptionLabel) diff --git a/MobileWallet/Screens/Settings/BackUpSettings/SeedPhraseViewController.swift b/MobileWallet/Screens/Settings/BackUpSettings/SeedPhraseViewController.swift index 490f9e91..3fa06c02 100644 --- a/MobileWallet/Screens/Settings/BackUpSettings/SeedPhraseViewController.swift +++ b/MobileWallet/Screens/Settings/BackUpSettings/SeedPhraseViewController.swift @@ -99,14 +99,14 @@ extension SeedPhraseViewController { override func setupNavigationBar() { super.setupNavigationBar() - navigationBar.title = NSLocalizedString("Back Up Wallet", comment: "RecoveryPhraseViewController title") + navigationBar.title = NSLocalizedString("seed_phrase.title", comment: "SeedPhrase view") } private func setupHeader() { descriptionLabel.numberOfLines = 0 descriptionLabel.font = Theme.shared.fonts.settingsSeedPhraseDescription descriptionLabel.textColor = Theme.shared.colors.settingsSeedPhraseDescription - descriptionLabel.text = NSLocalizedString("Carefully write these 24 words down in order, and keep the paper somewhere secure where others can’t access it.", comment: "SeedPhraseViewController header description") + descriptionLabel.text = NSLocalizedString("seed_phrase.header", comment: "SeedPhrase view") view.addSubview(descriptionLabel) @@ -142,7 +142,7 @@ extension SeedPhraseViewController { agreementContainer.addSubview(agreementLabel) - agreementLabel.text = NSLocalizedString("I understand that if I lose my recovery seed phrase I will not be able to restore my wallet.", comment: "SeedPhraseViewController agreement") + agreementLabel.text = NSLocalizedString("seed_phrase.agreement", comment: "SeedPhrase view") agreementLabel.font = Theme.shared.fonts.settingsSeedPhraseAgreement agreementLabel.textColor = Theme.shared.colors.settingsSeedPhraseAgreement! @@ -154,7 +154,7 @@ extension SeedPhraseViewController { } private func setupContinueButton() { - continueButton.setTitle(NSLocalizedString("Verify Seed Phrase", comment: "Recovery phrase continue button"), for: .normal) + continueButton.setTitle(NSLocalizedString("seed_phrase.verify_seed_phrase", comment: "SeedPhrase view"), for: .normal) continueButton.addTarget(self, action: #selector(continueButtonAction), for: .touchUpInside) continueButton.variation = .disabled view.addSubview(continueButton) diff --git a/MobileWallet/Screens/Settings/BackUpSettings/VerifyPhraseViewController.swift b/MobileWallet/Screens/Settings/BackUpSettings/VerifyPhraseViewController.swift index a211b02b..194a9780 100644 --- a/MobileWallet/Screens/Settings/BackUpSettings/VerifyPhraseViewController.swift +++ b/MobileWallet/Screens/Settings/BackUpSettings/VerifyPhraseViewController.swift @@ -82,7 +82,7 @@ extension VerifyPhraseViewController { override func setupNavigationBar() { super.setupNavigationBar() - navigationBar.title = NSLocalizedString("Verify Seed Phrase", comment: "ConfirmPhraseViewController title") + navigationBar.title = NSLocalizedString("verify_phrase.title", comment: "VerifyPhrase view") } private func setupScrollView() { @@ -114,7 +114,7 @@ extension VerifyPhraseViewController { private func setupHeaderLabel() { headerLabel.font = Theme.shared.fonts.settingsSeedPhraseDescription headerLabel.textColor = Theme.shared.colors.settingsSeedPhraseDescription - headerLabel.text = NSLocalizedString("Select the words in the correct order.", comment: "ConfirmPhraseViewController header title") + headerLabel.text = NSLocalizedString("verify_phrase.header", comment: "VerifyPhrase view") stackView.addArrangedSubview(headerLabel) stackView.setCustomSpacing(20, after: headerLabel) @@ -150,7 +150,7 @@ extension VerifyPhraseViewController { fillablePhraseView.bottomAnchor.constraint(lessThanOrEqualTo: fillablePhraseContainer.bottomAnchor, constant: -20).isActive = true fillableContainerDescription.numberOfLines = 0 - fillableContainerDescription.text = NSLocalizedString("Tap on the words above in the correct order", comment: "Fillable phrase container description") + fillableContainerDescription.text = NSLocalizedString("verify_phrase.container_description", comment: "VerifyPhrase view") fillableContainerDescription.font = Theme.shared.fonts.settingsFillablePhraseViewDescription fillableContainerDescription.textColor = Theme.shared.colors.settingsFillablePhraseViewDescription fillableContainerDescription.textAlignment = .center @@ -197,7 +197,7 @@ extension VerifyPhraseViewController { warningLabel.textColor = Theme.shared.colors.warningBoxBorder warningLabel.font = Theme.shared.fonts.warningBoxTitleLabel - warningLabel.text = NSLocalizedString("Nope, that’s not right", comment: "VerifyPhraseViewController warning") + warningLabel.text = NSLocalizedString("verify_phrase.warning", comment: "VerifyPhrase view") warningLabel.translatesAutoresizingMaskIntoConstraints = false warningLabel.centerXAnchor.constraint(equalTo: warningView.centerXAnchor).isActive = true @@ -219,7 +219,7 @@ extension VerifyPhraseViewController { } private func setupContinueButton() { - continueButton.setTitle(NSLocalizedString("Complete Verification", comment: "Recovery phrase continue button"), for: .normal) + continueButton.setTitle(NSLocalizedString("verify_phrase.complete", comment: "VerifyPhrase view"), for: .normal) continueButton.addTarget(self, action: #selector(continueButtonAction), for: .touchUpInside) continueButton.variation = .disabled diff --git a/MobileWallet/Screens/Settings/SettingsParentViewController.swift b/MobileWallet/Screens/Settings/SettingsParentViewController.swift index ae97d670..0a18364f 100644 --- a/MobileWallet/Screens/Settings/SettingsParentViewController.swift +++ b/MobileWallet/Screens/Settings/SettingsParentViewController.swift @@ -57,7 +57,7 @@ extension SettingsParentViewController { } @objc func setupNavigationBar() { - navigationBar.title = NSLocalizedString("Settings", comment: "SettingsViewController title") + navigationBar.title = NSLocalizedString("settings.title", comment: "Settings view") navigationBar.verticalPositioning = .custom(24) view.addSubview(navigationBar) diff --git a/MobileWallet/Screens/Settings/SettingsViewController.swift b/MobileWallet/Screens/Settings/SettingsViewController.swift index 59befd36..eb4a9c63 100644 --- a/MobileWallet/Screens/Settings/SettingsViewController.swift +++ b/MobileWallet/Screens/Settings/SettingsViewController.swift @@ -53,8 +53,8 @@ class SettingsViewController: SettingsParentTableViewController { var rawValue: String { switch self { - case .securityHeader: return NSLocalizedString("Security", comment: "SettingsItemHeader") - case .moreHeader: return NSLocalizedString("More", comment: "SettingsItemHeader") + case .securityHeader: return NSLocalizedString("settings.item.header.security", comment: "Settings view") + case .moreHeader: return NSLocalizedString("settings.item.header.more", comment: "Settings view") } } } @@ -70,13 +70,13 @@ class SettingsViewController: SettingsParentTableViewController { var rawValue: String { switch self { - case .backUpWallet: return NSLocalizedString("Back Up Wallet", comment: "SettingsItemTitle") + case .backUpWallet: return NSLocalizedString("settings.item.backup_wallet", comment: "Settings view") - case .visitTari: return NSLocalizedString("Visit Tari.com", comment: "SettingsItemTitle") - case .contributeToTariAurora: return NSLocalizedString("Contribute to Tari Aurora", comment: "SettingsItemTitle") - case .userAgreement: return NSLocalizedString("User Agreement", comment: "SettingsItemTitle") - case .privacyPolicy: return NSLocalizedString("Privacy Policy", comment: "SettingsItemTitle") - case .disclaimer: return NSLocalizedString("Disclaimer", comment: "SettingsItemTitle") + case .visitTari: return NSLocalizedString("settings.item.visit_tari", comment: "Settings view") + case .contributeToTariAurora: return NSLocalizedString("settings.item.contribute_to_tari", comment: "Settings view") + case .userAgreement: return NSLocalizedString("settings.item.user_agreement", comment: "Settings view") + case .privacyPolicy: return NSLocalizedString("Privacy Policy", comment: "Settings view") + case .disclaimer: return NSLocalizedString("settings.item.disclaimer", comment: "Settings view") } } } @@ -205,7 +205,7 @@ extension SettingsViewController { self?.navigationController?.dismiss(animated: true, completion: nil) } - let title = NSLocalizedString("Done", comment: "SettingsViewController Done button") + let title = NSLocalizedString("settings.done", comment: "Settings view") navigationBar.rightButton.setTitle(title, for: .normal) navigationBar.rightButton.setTitleColor(Theme.shared.colors.settingsDoneButtonTitle, for: .normal) navigationBar.rightButton.titleLabel?.font = Theme.shared.fonts.settingsDoneButton diff --git a/MobileWallet/TariLib/Wrappers/Utils/ErrorDescriptions.swift b/MobileWallet/TariLib/Wrappers/Utils/ErrorDescriptions.swift index 53b0fe28..deeef883 100644 --- a/MobileWallet/TariLib/Wrappers/Utils/ErrorDescriptions.swift +++ b/MobileWallet/TariLib/Wrappers/Utils/ErrorDescriptions.swift @@ -45,41 +45,41 @@ extension WalletErrors: LocalizedError { switch self { case .generic(let code): //TODO create a map of Tari errors from rust - return "\(NSLocalizedString("Generic error code:", comment: "Wallet errors")) \(code)." + return "\(NSLocalizedString("wallet.error.generic_code", comment: "Wallet error")) \(code)." case .insufficientFunds(let microTariSpendable): - return "\(NSLocalizedString("Insufficient funds. Available spendable Tari:", comment: "Wallet errors")) \(microTariSpendable.formatted)." + return "\(NSLocalizedString("wallet.error.insufficient_funds", comment: "Wallet error")) \(microTariSpendable.formatted)." case .addUpdateContact: - return NSLocalizedString("Failed to add/update contact.", comment: "Wallet errors") + return NSLocalizedString("wallet.error.add_update_contact", comment: "Wallet error") case .removeContact: - return NSLocalizedString("Failed to remove contact.", comment: "Wallet errors") + return NSLocalizedString("wallet.error.remove_contact", comment: "Wallet error") case .addOwnContact: - return NSLocalizedString("Cannot add your own public key as a contact.", comment: "Wallet errors") + return NSLocalizedString("wallet.error.add_own_contact", comment: "Wallet error") case .invalidPublicKeyHex: - return NSLocalizedString("Invalid public key hex.", comment: "Wallet errors") + return NSLocalizedString("wallet.error.invalid_public_key_hex", comment: "Wallet error") case .generateTestData: - return NSLocalizedString("Failed to generate test data.", comment: "Wallet errors") + return NSLocalizedString("wallet.error.test_data", comment: "Wallet error") case .generateTestReceiveTransaction: - return NSLocalizedString("Failed to generate test receieve transaction.", comment: "Wallet errors") + return NSLocalizedString("wallet.error.test_receieve_transaction", comment: "Wallet error") case .sendingTransaction: - return NSLocalizedString("Failed to send transaction.", comment: "Wallet errors") + return NSLocalizedString("wallet.error.send_transaction", comment: "Wallet error") case .testTransactionBroadcast: - return NSLocalizedString("Failed to broadcast test transaction.", comment: "Wallet errors") + return NSLocalizedString("wallet.error.broadcast", comment: "Wallet error") case .testTransactionMined: - return NSLocalizedString("Failed to mine test transaction.", comment: "Wallet errors") + return NSLocalizedString("wallet.error.mine_transaction", comment: "Wallet error") case .testSendCompleteTransaction: - return NSLocalizedString("Failed to complete test transaction.", comment: "Wallet errors") + return NSLocalizedString("wallet.error.test_transaction", comment: "Wallet error") case .completedTransactionById: - return NSLocalizedString("Failed to find completed transaction by ID.", comment: "Wallet errors") + return NSLocalizedString("wallet.error.find_completed_transaction", comment: "Wallet error") case .cancelledTransactionById: - return NSLocalizedString("Failed to find cancelled transaction by ID.", comment: "Wallet errors") + return NSLocalizedString("wallet.error.find_canceled_transaction", comment: "Wallet error") case .walletNotInitialized: - return NSLocalizedString("Tari wallet not yet initialized", comment: "Wallet errors") + return NSLocalizedString("wallet.error.wallet_not_initialized", comment: "Wallet error") case .invalidSignatureAndNonceString: - return NSLocalizedString("Invalid signature created", comment: "Wallet errors") + return NSLocalizedString("wallet.error.invalid_signature", comment: "Wallet error") case .cancelNonPendingTransaction: - return NSLocalizedString("Cannot cancel a transaction that is not pending", comment: "Wallet errors") + return NSLocalizedString("wallet.error.cancel_non_pending_transaction", comment: "Wallet error") case .transactionsToCancel: - return NSLocalizedString("Could not fetch inbound or outbound transactions to cancel", comment: "Wallet errors") + return NSLocalizedString("wallet.error.fetch_transactions_to_cancel", comment: "Wallet error") } } } @@ -92,17 +92,17 @@ extension KeyServerError: LocalizedError { return message } - return NSLocalizedString("Tari faucet server error. Status code: \(statusCode).", comment: "Tari key server error") + return NSLocalizedString("key_server.error.server", comment: "Tari key server error") + " \(statusCode)." case .unknown: - return NSLocalizedString("Unknown Tari faucet error.", comment: "Tari key server error") + return NSLocalizedString("key_server.error.unknown", comment: "Tari key server error") case .invalidSignature: - return NSLocalizedString("Invalid signature sent to Tari key server.", comment: "Tari key server error") - case .allCoinsAllAllocated: - return NSLocalizedString("All coins are allocated.", comment: "Tari key server error") + return NSLocalizedString("key_server.error.invalid_signature", comment: "Tari key server error") + case .allCoinsAllocated: + return NSLocalizedString("key_server.error.all_coins_allocated", comment: "Tari key server error") case .missingResponse: - return NSLocalizedString("Missing response from Tari key server.", comment: "Tari key server error") + return NSLocalizedString("key_server.error.missing_response", comment: "Tari key server error") case .responseInvalid: - return NSLocalizedString("Invalid response from Tari key server.", comment: "Tari key server error") + return NSLocalizedString("key_server.error.response_invalid", comment: "Tari key server error") } } } diff --git a/MobileWallet/TariLib/Wrappers/Utils/KeyServer.swift b/MobileWallet/TariLib/Wrappers/Utils/KeyServer.swift index 878891a3..262321de 100644 --- a/MobileWallet/TariLib/Wrappers/Utils/KeyServer.swift +++ b/MobileWallet/TariLib/Wrappers/Utils/KeyServer.swift @@ -43,7 +43,7 @@ import Foundation enum KeyServerError: Error { case server(_ statusCode: Int, message: String?) case invalidSignature - case allCoinsAllAllocated + case allCoinsAllocated case missingResponse case responseInvalid case unknown @@ -58,15 +58,14 @@ class KeyServer { private let MESSAGE_PREFIX = "Hello Tari from" private let TARIBOT_MESSAGE1 = String( format: NSLocalizedString( - "💸 Here’s some %@!", + "taribot.message1.with_param", comment: "TariBot transaction" ), TariSettings.shared.network.currencyDisplayTicker ) private let TARIBOT_MESSAGE2 = String( format: NSLocalizedString( - "Nice work! Here's more %@ to fill your coffers. Be sure to hit the store icon to see real, " - + "exclusive items you can redeem with your \"hard-earned\" %@.", + "taribot.message2.with_params", comment: "TariBot transaction" ), TariSettings.shared.network.currencyDisplayTicker, diff --git a/MobileWallet/UIElements/AnimatedRefreshingView.swift b/MobileWallet/UIElements/AnimatedRefreshingView.swift index 8cac0377..ac57c889 100644 --- a/MobileWallet/UIElements/AnimatedRefreshingView.swift +++ b/MobileWallet/UIElements/AnimatedRefreshingView.swift @@ -88,31 +88,31 @@ private class RefreshingInnerView: UIView { case .loading: emojiLabel.text = "⏳" spinner.startAnimating() - statusLabel.text = NSLocalizedString("Checking for Updates", comment: "Refresh view") + statusLabel.text = NSLocalizedString("refresh_view.checking", comment: "Refresh view") statusLabel.textColor = Theme.shared.colors.refreshViewLabelLoading case .receiving: emojiLabel.text = "🤝" spinner.startAnimating() - statusLabel.text = NSLocalizedString("Receiving new transaction", comment: "Refresh view") + statusLabel.text = NSLocalizedString("refresh_view.receiving_new_transactions", comment: "Refresh view") statusLabel.textColor = Theme.shared.colors.refreshViewLabelLoading case .success: - statusLabel.text = NSLocalizedString("You are up to date!", comment: "Refresh view") + statusLabel.text = NSLocalizedString("refresh_view.success", comment: "Refresh view") spinner.stopAnimating() statusLabel.textColor = Theme.shared.colors.refreshViewLabelSuccess case .txWaitingForRecipient: emojiLabel.text = "" spinner.stopAnimating() - statusLabel.text = NSLocalizedString("Waiting for recipient to come online", comment: "Refresh view") + statusLabel.text = NSLocalizedString("refresh_view.waiting_for_recipient", comment: "Refresh view") statusLabel.textColor = Theme.shared.colors.refreshViewLabelLoading case .txWaitingForSender: emojiLabel.text = "" spinner.stopAnimating() - statusLabel.text = NSLocalizedString("Waiting for sender to complete transaction", comment: "Refresh view") + statusLabel.text = NSLocalizedString("refresh_view.waiting_for_sender", comment: "Refresh view") statusLabel.textColor = Theme.shared.colors.refreshViewLabelLoading case .txCompleted: emojiLabel.text = "" spinner.stopAnimating() - statusLabel.text = NSLocalizedString("Completing final processing…", comment: "Refresh view") + statusLabel.text = NSLocalizedString("refresh_view.final_processing", comment: "Refresh view") statusLabel.textColor = Theme.shared.colors.refreshViewLabelLoading } } diff --git a/MobileWallet/UIElements/EmoticonView.swift b/MobileWallet/UIElements/EmoticonView.swift index 30c7999e..e31d6f8b 100644 --- a/MobileWallet/UIElements/EmoticonView.swift +++ b/MobileWallet/UIElements/EmoticonView.swift @@ -378,7 +378,7 @@ extension EmoticonView { private func showMenu() { emojiMenu.alpha = 0.0 - emojiMenu.title = NSLocalizedString("Copy Emoji ID", comment: "") + emojiMenu.title = NSLocalizedString("emoji.copy", comment: "Emoji view") emojiMenu.completion = { [weak self] isLongPress in guard let self = self else { return } diff --git a/MobileWallet/en.lproj/Localizable.strings b/MobileWallet/en.lproj/Localizable.strings new file mode 100644 index 00000000..df66a157 Binary files /dev/null and b/MobileWallet/en.lproj/Localizable.strings differ