chore: use i18n resource in stead of raw string

This commit is contained in:
CMK 2021-09-16 18:26:35 +08:00
parent 99f15fafed
commit cf52898348
6 changed files with 7 additions and 7 deletions

View File

@ -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
}
}

View File

@ -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)

View File

@ -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)
}
}

View File

@ -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
}
}

View File

@ -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)

View File

@ -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 { }
}