2
2
mirror of https://github.com/mastodon/mastodon-ios synced 2025-04-11 22:58:02 +02:00

Sprinkle in some, you guessed it: Localization (IOS-241)

This commit is contained in:
Nathan Mattes 2024-07-24 12:19:20 +02:00
parent f3c035ce92
commit b3bfa5101b
8 changed files with 24 additions and 15 deletions

View File

@ -753,8 +753,10 @@
"suspend": "Your account has been suspended.",
"learn_more": "Learn More"
},
"filtered_notification_banner": {
"title": "Filtered Notifications"
"filtered_notification": {
"title": "Filtered Notifications",
"accept": "Accept",
"dismiss": "Dismiss",
},
"policy": {
"title": "Filter Notifications from…",

View File

@ -753,8 +753,10 @@
"suspend": "Your account has been suspended.",
"learn_more": "Learn More"
},
"filtered_notification_banner": {
"title": "Filtered Notifications"
"filtered_notification": {
"title": "Filtered Notifications",
"accept": "Accept",
"dismiss": "Dismiss",
},
"policy": {
"title": "Filter Notifications from…",

View File

@ -30,7 +30,7 @@ class NotificationFilteringBannerTableViewCell: UITableViewCell {
iconImageWrapperView.addSubview(iconImageView)
titleLabel = UILabel()
titleLabel.text = L10n.Scene.Notification.FilteredNotificationBanner.title
titleLabel.text = L10n.Scene.Notification.FilteredNotification.title
titleLabel.font = UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 17, weight: .regular))
subtitleLabel = UILabel()

View File

@ -3,6 +3,7 @@
import UIKit
import MastodonCore
import MastodonSDK
import MastodonLocalization
protocol AccountNotificationTimelineViewControllerDelegate: AnyObject {
func acceptRequest(_ viewController: AccountNotificationTimelineViewController, request: Mastodon.Entity.NotificationRequest, completion: @escaping (() -> Void))
@ -29,7 +30,7 @@ class AccountNotificationTimelineViewController: NotificationTimelineViewControl
//TODO: Localization
func menu() -> UIMenu {
let menu = UIMenu(children: [
UIAction(title: "Accept", image: UIImage(systemName: "checkmark")) { [weak self] _ in
UIAction(title: L10n.Scene.Notification.FilteredNotification.accept, image: UIImage(systemName: "checkmark")) { [weak self] _ in
guard let self else { return }
coordinator.showLoading()
@ -38,7 +39,7 @@ class AccountNotificationTimelineViewController: NotificationTimelineViewControl
}
coordinator.hideLoading()
},
UIAction(title: "Dismiss", image: UIImage(systemName: "speaker.slash")) { [weak self] _ in
UIAction(title: L10n.Scene.Notification.FilteredNotification.dismiss, image: UIImage(systemName: "speaker.slash")) { [weak self] _ in
guard let self else { return }
coordinator.showLoading()

View File

@ -57,8 +57,7 @@ class NotificationRequestTableViewCell: UITableViewCell {
acceptNotificationRequestButton.translatesAutoresizingMaskIntoConstraints = false
acceptNotificationRequestButton.titleLabel?.font = UIFont.systemFont(ofSize: 17, weight: .semibold)
acceptNotificationRequestButton.setTitleColor(.white, for: .normal)
//TODO: Localization
acceptNotificationRequestButton.setTitle("Accept", for: .normal)
acceptNotificationRequestButton.setTitle(L10n.Scene.Notification.FilteredNotification.accept, for: .normal)
acceptNotificationRequestButton.setImage(UIImage(systemName: "checkmark"), for: .normal)
acceptNotificationRequestButton.imageView?.contentMode = .scaleAspectFit
acceptNotificationRequestButton.setBackgroundImage(.placeholder(color: Asset.Scene.Notification.confirmFollowRequestButtonBackground.color), for: .normal)
@ -83,8 +82,7 @@ class NotificationRequestTableViewCell: UITableViewCell {
rejectNotificationRequestButton.translatesAutoresizingMaskIntoConstraints = false
rejectNotificationRequestButton.titleLabel?.font = UIFont.systemFont(ofSize: 17, weight: .semibold)
rejectNotificationRequestButton.setTitleColor(.black, for: .normal)
//TODO: Localization
rejectNotificationRequestButton.setTitle("Dismiss", for: .normal)
rejectNotificationRequestButton.setTitle(L10n.Scene.Notification.FilteredNotification.dismiss, for: .normal)
rejectNotificationRequestButton.setImage(UIImage(systemName: "speaker.slash"), for: .normal)
rejectNotificationRequestButton.imageView?.contentMode = .scaleAspectFit
rejectNotificationRequestButton.setInsets(forContentPadding: UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8), imageTitlePadding: 8)

View File

@ -59,7 +59,7 @@ class NotificationRequestsTableViewController: UIViewController, NeedsDependency
tableView.delegate = self
self.dataSource = dataSource
title = L10n.Scene.Notification.FilteredNotificationBanner.title
title = L10n.Scene.Notification.FilteredNotification.title
}
required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") }

View File

@ -895,9 +895,13 @@ public enum L10n {
}
}
public enum Notification {
public enum FilteredNotificationBanner {
public enum FilteredNotification {
/// Accept
public static let accept = L10n.tr("Localizable", "Scene.Notification.FilteredNotification.Accept", fallback: "Accept")
/// Dismiss
public static let dismiss = L10n.tr("Localizable", "Scene.Notification.FilteredNotification.Dismiss", fallback: "Dismiss")
/// Filtered Notifications
public static let title = L10n.tr("Localizable", "Scene.Notification.FilteredNotificationBanner.Title", fallback: "Filtered Notifications")
public static let title = L10n.tr("Localizable", "Scene.Notification.FilteredNotification.Title", fallback: "Filtered Notifications")
}
public enum FollowRequest {
/// Accept

View File

@ -316,7 +316,9 @@ uploaded to Mastodon.";
"Scene.Login.ServerSearchField.Placeholder" = "Enter URL or search for your server";
"Scene.Login.Subtitle" = "Log in with the server where you created your account.";
"Scene.Login.Title" = "Welcome Back";
"Scene.Notification.FilteredNotificationBanner.Title" = "Filtered Notifications";
"Scene.Notification.FilteredNotification.Accept" = "Accept";
"Scene.Notification.FilteredNotification.Dismiss" = "Dismiss";
"Scene.Notification.FilteredNotification.Title" = "Filtered Notifications";
"Scene.Notification.FollowRequest.Accept" = "Accept";
"Scene.Notification.FollowRequest.Accepted" = "Accepted";
"Scene.Notification.FollowRequest.Reject" = "reject";