From cf528983486d032c6ea2438cce99bd61888e4ff7 Mon Sep 17 00:00:00 2001 From: CMK Date: Thu, 16 Sep 2021 18:26:35 +0800 Subject: [PATCH] chore: use i18n resource in stead of raw string --- Mastodon/Scene/Account/AccountViewController.swift | 2 +- Mastodon/Scene/Account/Cell/AddAccountTableViewCell.swift | 2 +- Mastodon/Scene/Account/View/BadgeButton.swift | 2 +- Mastodon/Scene/MainTab/MainTabBarController+Wizard.swift | 4 ++-- Mastodon/Scene/MainTab/MainTabBarController.swift | 2 +- Mastodon/Scene/Onboarding/Welcome/View/WizardCardView.swift | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Mastodon/Scene/Account/AccountViewController.swift b/Mastodon/Scene/Account/AccountViewController.swift index a7a0992e1..bb87e0a6c 100644 --- a/Mastodon/Scene/Account/AccountViewController.swift +++ b/Mastodon/Scene/Account/AccountViewController.swift @@ -110,7 +110,7 @@ extension AccountListViewController { dragIndicatorView.addGestureRecognizer(dragIndicatorTapGestureRecognizer) dragIndicatorTapGestureRecognizer.addTarget(self, action: #selector(AccountListViewController.dragIndicatorTapGestureRecognizerHandler(_:))) dragIndicatorView.isAccessibilityElement = true - dragIndicatorView.accessibilityLabel = "Dismiss Account Switcher" + dragIndicatorView.accessibilityLabel = L10n.Scene.AccountList.dismissAccountSwitcher } } diff --git a/Mastodon/Scene/Account/Cell/AddAccountTableViewCell.swift b/Mastodon/Scene/Account/Cell/AddAccountTableViewCell.swift index 0ac022c5d..09d3fa554 100644 --- a/Mastodon/Scene/Account/Cell/AddAccountTableViewCell.swift +++ b/Mastodon/Scene/Account/Cell/AddAccountTableViewCell.swift @@ -20,7 +20,7 @@ final class AddAccountTableViewCell: UITableViewCell { let label = UILabel() label.font = UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 17, weight: .regular), maximumPointSize: 22) label.textColor = Asset.Colors.Label.primary.color - label.text = "Add Account" // TODO: i18n + label.text = L10n.Scene.AccountList.addAccount return label }() let usernameLabel = MetaLabel(style: .accountListUsername) diff --git a/Mastodon/Scene/Account/View/BadgeButton.swift b/Mastodon/Scene/Account/View/BadgeButton.swift index c55448ae4..6d92a8471 100644 --- a/Mastodon/Scene/Account/View/BadgeButton.swift +++ b/Mastodon/Scene/Account/View/BadgeButton.swift @@ -41,6 +41,6 @@ extension BadgeButton { let number = min(99, max(0, number)) setTitle("\(number)", for: .normal) self.isHidden = number == 0 - accessibilityLabel = "\(number) unread notification" + accessibilityLabel = L10n.A11y.Plural.Count.Unread.notification(number) } } diff --git a/Mastodon/Scene/MainTab/MainTabBarController+Wizard.swift b/Mastodon/Scene/MainTab/MainTabBarController+Wizard.swift index 0f143a98e..8f3f2eea4 100644 --- a/Mastodon/Scene/MainTab/MainTabBarController+Wizard.swift +++ b/Mastodon/Scene/MainTab/MainTabBarController+Wizard.swift @@ -47,13 +47,13 @@ extension MainTabBarController.Wizard { case multipleAccountSwitch var title: String { - return "New in Mastodon" + return L10n.Scene.Wizard.newInMastodon } var description: String { switch self { case .multipleAccountSwitch: - return "Switch between multiple accounts by holding the profile button." + return L10n.Scene.Wizard.multipleAccountSwitchIntroDescription } } diff --git a/Mastodon/Scene/MainTab/MainTabBarController.swift b/Mastodon/Scene/MainTab/MainTabBarController.swift index f07a1f905..1b261af32 100644 --- a/Mastodon/Scene/MainTab/MainTabBarController.swift +++ b/Mastodon/Scene/MainTab/MainTabBarController.swift @@ -242,7 +242,7 @@ extension MainTabBarController { guard let profileTabItem = _profileTabItem else { return } let currentUserDisplayName = activeMastodonAuthentication?.user.displayNameWithFallback ?? "no user" - profileTabItem.accessibilityHint = "Current selected profile: \(currentUserDisplayName). Double tap then hold to show account switcher" + profileTabItem.accessibilityHint = L10n.Scene.AccountList.tabBarHint(currentUserDisplayName) } .store(in: &disposeBag) diff --git a/Mastodon/Scene/Onboarding/Welcome/View/WizardCardView.swift b/Mastodon/Scene/Onboarding/Welcome/View/WizardCardView.swift index defe6f4ee..024fb205d 100644 --- a/Mastodon/Scene/Onboarding/Welcome/View/WizardCardView.swift +++ b/Mastodon/Scene/Onboarding/Welcome/View/WizardCardView.swift @@ -127,7 +127,7 @@ extension WizardCardView { override var accessibilityHint: String? { get { - return "Wizard for account switcher on the Profile tab. Double tap to dismiss this wizard" + return L10n.Scene.Wizard.accessibilityHint } set { } }