Sprinkle in some localizations on Notificaiton-Screen (IOS-14)
This commit is contained in:
parent
fedde3e159
commit
67e3078df9
|
@ -742,6 +742,22 @@
|
||||||
"open_in_mastodon": "Open in Mastodon",
|
"open_in_mastodon": "Open in Mastodon",
|
||||||
"open_in_browser": "Open in Browser"
|
"open_in_browser": "Open in Browser"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"notifications": {
|
||||||
|
"title": "Notifications",
|
||||||
|
"policy": {
|
||||||
|
"title": "Get Notifications from",
|
||||||
|
"anyone": "Anyone",
|
||||||
|
"followers": "People who follow you",
|
||||||
|
"follow": "People you follow",
|
||||||
|
"noone": "No one"
|
||||||
|
},
|
||||||
|
"alert": {
|
||||||
|
"mentions_and_replies": "Mentions & Replies",
|
||||||
|
"boosts": "Boosts",
|
||||||
|
"favorites": "Favorites",
|
||||||
|
"new_followers": "New Followers"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"report": {
|
"report": {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright © 2023 Mastodon gGmbH. All rights reserved.
|
// Copyright © 2023 Mastodon gGmbH. All rights reserved.
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
import MastodonLocalization
|
||||||
|
|
||||||
class NotificationSettingTableViewCell: UITableViewCell {
|
class NotificationSettingTableViewCell: UITableViewCell {
|
||||||
static let reuseIdentifier = "NotificationSettingTableViewCell"
|
static let reuseIdentifier = "NotificationSettingTableViewCell"
|
||||||
|
@ -13,8 +14,7 @@ class NotificationSettingTableViewCell: UITableViewCell {
|
||||||
break
|
break
|
||||||
case .policy:
|
case .policy:
|
||||||
var content = UIListContentConfiguration.valueCell()
|
var content = UIListContentConfiguration.valueCell()
|
||||||
//TODO: @zeitschlag Localization
|
content.text = L10n.Scene.Settings.Notifications.Policy.title
|
||||||
content.text = "Get Notifications from"
|
|
||||||
content.secondaryText = viewModel.selectedPolicy.title
|
content.secondaryText = viewModel.selectedPolicy.title
|
||||||
|
|
||||||
contentConfiguration = content
|
contentConfiguration = content
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright © 2023 Mastodon gGmbH. All rights reserved.
|
// Copyright © 2023 Mastodon gGmbH. All rights reserved.
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import MastodonLocalization
|
||||||
|
|
||||||
struct NotificationSettingsSection: Hashable {
|
struct NotificationSettingsSection: Hashable {
|
||||||
let entries: [NotificationSettingEntry]
|
let entries: [NotificationSettingEntry]
|
||||||
|
@ -20,13 +21,13 @@ enum NotificationPolicy: Hashable {
|
||||||
var title: String {
|
var title: String {
|
||||||
switch self {
|
switch self {
|
||||||
case .anyone:
|
case .anyone:
|
||||||
return "Anyone"
|
return L10n.Scene.Settings.Notifications.Policy.anyone
|
||||||
case .followers:
|
case .followers:
|
||||||
return "People who follow you"
|
return L10n.Scene.Settings.Notifications.Policy.followers
|
||||||
case .follow:
|
case .follow:
|
||||||
return "People you follow"
|
return L10n.Scene.Settings.Notifications.Policy.follow
|
||||||
case .noone:
|
case .noone:
|
||||||
return "No one"
|
return L10n.Scene.Settings.Notifications.Policy.noone
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,13 +42,13 @@ enum NotificationAlert: Hashable, CaseIterable {
|
||||||
switch self {
|
switch self {
|
||||||
|
|
||||||
case .mentionsAndReplies:
|
case .mentionsAndReplies:
|
||||||
return "Mentions & Replies"
|
return L10n.Scene.Settings.Notifications.Alert.mentionsAndReplies
|
||||||
case .boosts:
|
case .boosts:
|
||||||
return "Boosts"
|
return L10n.Scene.Settings.Notifications.Alert.boosts
|
||||||
case .favorites:
|
case .favorites:
|
||||||
return "Favorites"
|
return L10n.Scene.Settings.Notifications.Alert.favorites
|
||||||
case .newFollowers:
|
case .newFollowers:
|
||||||
return "New Followers"
|
return L10n.Scene.Settings.Notifications.Alert.newFollowers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright © 2023 Mastodon gGmbH. All rights reserved.
|
// Copyright © 2023 Mastodon gGmbH. All rights reserved.
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
import MastodonLocalization
|
||||||
|
|
||||||
protocol NotificationSettingsViewControllerDelegate: AnyObject {
|
protocol NotificationSettingsViewControllerDelegate: AnyObject {
|
||||||
func showPolicyList(_ viewController: UIViewController, viewModel: NotificationSettingsViewModel)
|
func showPolicyList(_ viewController: UIViewController, viewModel: NotificationSettingsViewModel)
|
||||||
|
@ -66,7 +67,7 @@ class NotificationSettingsViewController: UIViewController {
|
||||||
view.addSubview(tableView)
|
view.addSubview(tableView)
|
||||||
tableView.pinToParent()
|
tableView.pinToParent()
|
||||||
|
|
||||||
title = "Notifications"
|
title = L10n.Scene.Settings.Notifications.title
|
||||||
}
|
}
|
||||||
|
|
||||||
required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") }
|
required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") }
|
||||||
|
@ -90,7 +91,10 @@ extension NotificationSettingsViewController: UITableViewDelegate {
|
||||||
|
|
||||||
let entry = sections[indexPath.section].entries[indexPath.row]
|
let entry = sections[indexPath.section].entries[indexPath.row]
|
||||||
|
|
||||||
if case let .policy = entry {
|
switch entry {
|
||||||
|
case .alert(_):
|
||||||
|
break
|
||||||
|
case .policy:
|
||||||
delegate?.showPolicyList(self, viewModel: viewModel)
|
delegate?.showPolicyList(self, viewModel: viewModel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1466,6 +1466,32 @@ public enum L10n {
|
||||||
/// Close Settings Window
|
/// Close Settings Window
|
||||||
public static let closeSettingsWindow = L10n.tr("Localizable", "Scene.Settings.Keyboard.CloseSettingsWindow", fallback: "Close Settings Window")
|
public static let closeSettingsWindow = L10n.tr("Localizable", "Scene.Settings.Keyboard.CloseSettingsWindow", fallback: "Close Settings Window")
|
||||||
}
|
}
|
||||||
|
public enum Notifications {
|
||||||
|
/// Notifications
|
||||||
|
public static let title = L10n.tr("Localizable", "Scene.Settings.Notifications.Title", fallback: "Notifications")
|
||||||
|
public enum Alert {
|
||||||
|
/// Boosts
|
||||||
|
public static let boosts = L10n.tr("Localizable", "Scene.Settings.Notifications.Alert.Boosts", fallback: "Boosts")
|
||||||
|
/// Favorites
|
||||||
|
public static let favorites = L10n.tr("Localizable", "Scene.Settings.Notifications.Alert.Favorites", fallback: "Favorites")
|
||||||
|
/// Mentions & Replies
|
||||||
|
public static let mentionsAndReplies = L10n.tr("Localizable", "Scene.Settings.Notifications.Alert.MentionsAndReplies", fallback: "Mentions & Replies")
|
||||||
|
/// New Followers
|
||||||
|
public static let newFollowers = L10n.tr("Localizable", "Scene.Settings.Notifications.Alert.NewFollowers", fallback: "New Followers")
|
||||||
|
}
|
||||||
|
public enum Policy {
|
||||||
|
/// Anyone
|
||||||
|
public static let anyone = L10n.tr("Localizable", "Scene.Settings.Notifications.Policy.Anyone", fallback: "Anyone")
|
||||||
|
/// People you follow
|
||||||
|
public static let follow = L10n.tr("Localizable", "Scene.Settings.Notifications.Policy.Follow", fallback: "People you follow")
|
||||||
|
/// People who follow you
|
||||||
|
public static let followers = L10n.tr("Localizable", "Scene.Settings.Notifications.Policy.Followers", fallback: "People who follow you")
|
||||||
|
/// No one
|
||||||
|
public static let noone = L10n.tr("Localizable", "Scene.Settings.Notifications.Policy.Noone", fallback: "No one")
|
||||||
|
/// Get Notifications from
|
||||||
|
public static let title = L10n.tr("Localizable", "Scene.Settings.Notifications.Policy.Title", fallback: "Get Notifications from")
|
||||||
|
}
|
||||||
|
}
|
||||||
public enum Overview {
|
public enum Overview {
|
||||||
/// About Mastodon
|
/// About Mastodon
|
||||||
public static let aboutMastodon = L10n.tr("Localizable", "Scene.Settings.Overview.AboutMastodon", fallback: "About Mastodon")
|
public static let aboutMastodon = L10n.tr("Localizable", "Scene.Settings.Overview.AboutMastodon", fallback: "About Mastodon")
|
||||||
|
|
|
@ -547,6 +547,17 @@ uploaded to Mastodon.";
|
||||||
"Scene.Settings.General.Links.OpenInMastodon" = "Open in Mastodon";
|
"Scene.Settings.General.Links.OpenInMastodon" = "Open in Mastodon";
|
||||||
"Scene.Settings.General.Links.OpenInBrowser" = "Open in Browser";
|
"Scene.Settings.General.Links.OpenInBrowser" = "Open in Browser";
|
||||||
|
|
||||||
|
"Scene.Settings.Notifications.Title" = "Notifications";
|
||||||
|
"Scene.Settings.Notifications.Policy.Title" = "Get Notifications from";
|
||||||
|
"Scene.Settings.Notifications.Policy.Anyone" = "Anyone";
|
||||||
|
"Scene.Settings.Notifications.Policy.Followers" = "People who follow you";
|
||||||
|
"Scene.Settings.Notifications.Policy.Follow" = "People you follow";
|
||||||
|
"Scene.Settings.Notifications.Policy.Noone" = "No one";
|
||||||
|
"Scene.Settings.Notifications.Alert.MentionsAndReplies" = "Mentions & Replies";
|
||||||
|
"Scene.Settings.Notifications.Alert.Boosts" = "Boosts";
|
||||||
|
"Scene.Settings.Notifications.Alert.Favorites" = "Favorites";
|
||||||
|
"Scene.Settings.Notifications.Alert.NewFollowers" = "New Followers";
|
||||||
|
|
||||||
"Scene.SuggestionAccount.FollowAll" = "Follow all";
|
"Scene.SuggestionAccount.FollowAll" = "Follow all";
|
||||||
"Scene.SuggestionAccount.Title" = "Popular on Mastodon";
|
"Scene.SuggestionAccount.Title" = "Popular on Mastodon";
|
||||||
"Scene.Thread.BackTitle" = "Post";
|
"Scene.Thread.BackTitle" = "Post";
|
||||||
|
|
Loading…
Reference in New Issue