diff --git a/Localization/app.json b/Localization/app.json index 978e865c2..9a8b901af 100644 --- a/Localization/app.json +++ b/Localization/app.json @@ -726,8 +726,14 @@ "privacy_policy": "Privacy Policy", "clear_media_storage": "Clear Media Storage" }, - "about_instance": { - "message_admin": "Message Admin" + + "server_details": { + "about": "About", + "rules": "Rules" + "about_instance": { + "title": "Adminstrator" + "message_admin": "Message Admin" + } }, "general": { "title": "General", diff --git a/Mastodon/Scene/Settings/Server Details/ServerDetailsViewController.swift b/Mastodon/Scene/Settings/Server Details/ServerDetailsViewController.swift index 12992c7cb..1734be1c3 100644 --- a/Mastodon/Scene/Settings/Server Details/ServerDetailsViewController.swift +++ b/Mastodon/Scene/Settings/Server Details/ServerDetailsViewController.swift @@ -2,6 +2,7 @@ import UIKit import MastodonSDK +import MastodonLocalization import MetaTextKit enum ServerDetailsTab: Int, CaseIterable { @@ -10,16 +11,13 @@ enum ServerDetailsTab: Int, CaseIterable { var title: String { switch self { - //TODO: Add localization @zeitschlag - case .about: return "About" - case .rules: return "Rules" + case .about: return L10n.Scene.Settings.ServerDetails.about + case .rules: return L10n.Scene.Settings.ServerDetails.rules } } } -protocol ServerDetailsViewControllerDelegate: AnyObject { - -} +protocol ServerDetailsViewControllerDelegate: AnyObject {} class ServerDetailsViewController: UIViewController { diff --git a/Mastodon/Scene/Settings/Server Details/Table View Components/AboutInstance.swift b/Mastodon/Scene/Settings/Server Details/Table View Components/AboutInstance.swift index cbe38f9a3..e0d5b61ba 100644 --- a/Mastodon/Scene/Settings/Server Details/Table View Components/AboutInstance.swift +++ b/Mastodon/Scene/Settings/Server Details/Table View Components/AboutInstance.swift @@ -2,9 +2,14 @@ import Foundation import MastodonSDK +import MastodonLocalization -enum AboutInstanceSection: Hashable { - case main +enum AboutInstanceSection: Int, Hashable { + case main = 0 + + var title: String { + return L10n.Scene.Settings.ServerDetails.AboutInstance.title + } } enum AboutInstanceItem: Hashable { diff --git a/Mastodon/Scene/Settings/Server Details/Table View Components/AboutInstanceTableViewDataSource.swift b/Mastodon/Scene/Settings/Server Details/Table View Components/AboutInstanceTableViewDataSource.swift index c047e0669..508097119 100644 --- a/Mastodon/Scene/Settings/Server Details/Table View Components/AboutInstanceTableViewDataSource.swift +++ b/Mastodon/Scene/Settings/Server Details/Table View Components/AboutInstanceTableViewDataSource.swift @@ -9,6 +9,8 @@ class AboutInstanceTableViewDataSource: UITableViewDiffableDataSource String? { - return "Administrator".uppercased() + guard let section = AboutInstanceSection(rawValue: section) else { return nil } + + return section.title.uppercased() } } diff --git a/Mastodon/Scene/Settings/Server Details/Table View Components/ContactAdminTableViewCell.swift b/Mastodon/Scene/Settings/Server Details/Table View Components/ContactAdminTableViewCell.swift index 32ad7d0f3..c538a90aa 100644 --- a/Mastodon/Scene/Settings/Server Details/Table View Components/ContactAdminTableViewCell.swift +++ b/Mastodon/Scene/Settings/Server Details/Table View Components/ContactAdminTableViewCell.swift @@ -14,7 +14,7 @@ class ContactAdminTableViewCell: UITableViewCell { configuration.textProperties.color = Asset.Colors.Brand.blurple.color configuration.image = UIImage(systemName: "envelope") configuration.imageProperties.tintColor = Asset.Colors.Brand.blurple.color - configuration.text = L10n.Scene.Settings.AboutInstance.messageAdmin + configuration.text = L10n.Scene.Settings.ServerDetails.AboutInstance.messageAdmin contentConfiguration = configuration } diff --git a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift index 35465deb5..54abafdc9 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift +++ b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift @@ -1416,10 +1416,6 @@ public enum L10n { } } public enum Settings { - public enum AboutInstance { - /// Message Admin - public static let messageAdmin = L10n.tr("Localizable", "Scene.Settings.AboutInstance.MessageAdmin", fallback: "Message Admin") - } public enum AboutMastodon { /// Clear Media Storage public static let clearMediaStorage = L10n.tr("Localizable", "Scene.Settings.AboutMastodon.ClearMediaStorage", fallback: "Clear Media Storage") @@ -1598,6 +1594,18 @@ public enum L10n { public static let title = L10n.tr("Localizable", "Scene.Settings.Section.SpicyZone.Title", fallback: "The Spicy Zone") } } + public enum ServerDetails { + /// About + public static let about = L10n.tr("Localizable", "Scene.Settings.ServerDetails.About", fallback: "About") + /// Rules + public static let rules = L10n.tr("Localizable", "Scene.Settings.ServerDetails.Rules", fallback: "Rules") + public enum AboutInstance { + /// Message Admin + public static let messageAdmin = L10n.tr("Localizable", "Scene.Settings.ServerDetails.AboutInstance.MessageAdmin", fallback: "Message Admin") + /// Administrator + public static let title = L10n.tr("Localizable", "Scene.Settings.ServerDetails.AboutInstance.Title", fallback: "Administrator") + } + } } public enum SuggestionAccount { /// Follow all diff --git a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings index 6a2233760..a3bf9d834 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings +++ b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings @@ -537,7 +537,10 @@ uploaded to Mastodon."; "Scene.Settings.AboutMastodon.PrivacyPolicy" = "Privacy Policy"; "Scene.Settings.AboutMastodon.ClearMediaStorage" = "Clear Media Storage"; -"Scene.Settings.AboutInstance.MessageAdmin" = "Message Admin"; +"Scene.Settings.ServerDetails.About" = "About"; +"Scene.Settings.ServerDetails.Rules" = "Rules"; +"Scene.Settings.ServerDetails.AboutInstance.Title" = "Administrator"; +"Scene.Settings.ServerDetails.AboutInstance.MessageAdmin" = "Message Admin"; "Scene.Settings.General.Title" = "General"; "Scene.Settings.General.Appearance.SectionTitle" = "Appearance"; diff --git a/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings b/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings index 6a2233760..a3bf9d834 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings +++ b/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings @@ -537,7 +537,10 @@ uploaded to Mastodon."; "Scene.Settings.AboutMastodon.PrivacyPolicy" = "Privacy Policy"; "Scene.Settings.AboutMastodon.ClearMediaStorage" = "Clear Media Storage"; -"Scene.Settings.AboutInstance.MessageAdmin" = "Message Admin"; +"Scene.Settings.ServerDetails.About" = "About"; +"Scene.Settings.ServerDetails.Rules" = "Rules"; +"Scene.Settings.ServerDetails.AboutInstance.Title" = "Administrator"; +"Scene.Settings.ServerDetails.AboutInstance.MessageAdmin" = "Message Admin"; "Scene.Settings.General.Title" = "General"; "Scene.Settings.General.Appearance.SectionTitle" = "Appearance";