Add localization to about-screen (IOS-14)

This commit is contained in:
Nathan Mattes 2023-06-27 20:36:40 +02:00
parent 921c97b2a7
commit 951f46353f
5 changed files with 66 additions and 28 deletions

View File

@ -709,12 +709,22 @@
"title": "Post from %s"
},
"settings": {
"title": "Settings",
"general": "General",
"notifications" = "Notifications",
"supportMastodon" = "Support Mastodon",
"aboutMastodon" = "About Mastodon",
"logout" = "Logout %@"
"overview": {
"title": "Settings",
"general": "General",
"notifications" = "Notifications",
"support_mastodon" = "Support Mastodon",
"about_mastodon" = "About Mastodon",
"logout" = "Logout %@"
}
"about_mastodon": {
"title": "About Mastodon",
"more_settings": "Even More Settings",
"contribute_to_mastodon": "Contribute to Mastodon",
"privacy_policy": "Privacy Policy",
"clear_media_storage": "Clear Media Storage"
}
},
"report": {
"title_report": "Report",

View File

@ -2,6 +2,7 @@
import Foundation
import MastodonCore
import MastodonLocalization
struct AboutSettingsSection: Hashable {
let entries: [AboutSettingsEntry]
@ -17,13 +18,13 @@ enum AboutSettingsEntry: Hashable {
switch self {
//TODO: @zeitschlag Add Localization
case .evenMoreSettings:
return "Even More Settings"
return L10n.Scene.Settings.AboutMastodon.moreSettings
case .contributeToMastodon:
return "Contribute to Mastodon"
return L10n.Scene.Settings.AboutMastodon.contributeToMastodon
case .privacyPolicy:
return "Privacy Policy"
return L10n.Scene.Settings.AboutMastodon.privacyPolicy
case .clearMediaCache(_):
return "Clear Media Storage"
return L10n.Scene.Settings.AboutMastodon.cleaerMediaStorage
}
}

View File

@ -17,15 +17,15 @@ enum SettingsEntry: Hashable {
var title: String {
switch self {
case .general:
return L10n.Scene.Settings.general
return L10n.Scene.Settings.Overview.general
case .notifications:
return L10n.Scene.Settings.notifications
return L10n.Scene.Settings.Overview.notifications
case .aboutMastodon:
return L10n.Scene.Settings.aboutMastodon
return L10n.Scene.Settings.Overview.aboutMastodon
case .supportMastodon:
return L10n.Scene.Settings.supportMastodon
return L10n.Scene.Settings.Overview.supportMastodon
case .logout(let accountName):
return L10n.Scene.Settings.logout(accountName)
return L10n.Scene.Settings.Overview.logout(accountName)
}
}

View File

@ -1416,20 +1416,18 @@ public enum L10n {
}
}
public enum Settings {
/// About Mastodon
public static let aboutMastodon = L10n.tr("Localizable", "Scene.Settings.AboutMastodon", fallback: "About Mastodon")
/// General
public static let general = L10n.tr("Localizable", "Scene.Settings.General", fallback: "General")
/// Logout %@
public static func logout(_ p1: Any) -> String {
return L10n.tr("Localizable", "Scene.Settings.Logout", String(describing: p1), fallback: "Logout %@")
public enum AboutMastodon {
/// Clear Media Storage
public static let cleaerMediaStorage = L10n.tr("Localizable", "Scene.Settings.AboutMastodon.CleaerMediaStorage", fallback: "Clear Media Storage")
/// Contribute to Mastodon
public static let contributeToMastodon = L10n.tr("Localizable", "Scene.Settings.AboutMastodon.ContributeToMastodon", fallback: "Contribute to Mastodon")
/// Even More Settings
public static let moreSettings = L10n.tr("Localizable", "Scene.Settings.AboutMastodon.MoreSettings", fallback: "Even More Settings")
/// PrivacyPolicy
public static let privacyPolicy = L10n.tr("Localizable", "Scene.Settings.AboutMastodon.PrivacyPolicy", fallback: "PrivacyPolicy")
/// About Mastodon
public static let title = L10n.tr("Localizable", "Scene.Settings.AboutMastodon.Title", fallback: "About Mastodon")
}
/// Notifications
public static let notifications = L10n.tr("Localizable", "Scene.Settings.Notifications", fallback: "Notifications")
/// Support Mastodon
public static let supportMastodon = L10n.tr("Localizable", "Scene.Settings.SupportMastodon", fallback: "Support Mastodon")
/// Settings
public static let title = L10n.tr("Localizable", "Scene.Settings.Title", fallback: "Settings")
public enum Footer {
/// Mastodon is open source software. You can report issues on GitHub at %@ (%@)
public static func mastodonDescription(_ p1: Any, _ p2: Any) -> String {
@ -1440,6 +1438,22 @@ public enum L10n {
/// Close Settings Window
public static let closeSettingsWindow = L10n.tr("Localizable", "Scene.Settings.Keyboard.CloseSettingsWindow", fallback: "Close Settings Window")
}
public enum Overview {
/// About Mastodon
public static let aboutMastodon = L10n.tr("Localizable", "Scene.Settings.Overview.AboutMastodon", fallback: "About Mastodon")
/// General
public static let general = L10n.tr("Localizable", "Scene.Settings.Overview.General", fallback: "General")
/// Logout %@
public static func logout(_ p1: Any) -> String {
return L10n.tr("Localizable", "Scene.Settings.Overview.Logout", String(describing: p1), fallback: "Logout %@")
}
/// Notifications
public static let notifications = L10n.tr("Localizable", "Scene.Settings.Overview.Notifications", fallback: "Notifications")
/// Support Mastodon
public static let supportMastodon = L10n.tr("Localizable", "Scene.Settings.Overview.SupportMastodon", fallback: "Support Mastodon")
/// Settings
public static let title = L10n.tr("Localizable", "Scene.Settings.Overview.Title", fallback: "Settings")
}
public enum Section {
public enum Appearance {
/// Automatic

View File

@ -530,6 +530,19 @@ uploaded to Mastodon.";
"Scene.Settings.AboutMastodon" = "About Mastodon";
"Scene.Settings.Logout" = "Logout %@";
"Scene.Settings.Overview.Title" = "Settings";
"Scene.Settings.Overview.General" = "General";
"Scene.Settings.Overview.Notifications" = "Notifications";
"Scene.Settings.Overview.SupportMastodon" = "Support Mastodon";
"Scene.Settings.Overview.AboutMastodon" = "About Mastodon";
"Scene.Settings.Overview.Logout" = "Logout %@";
"Scene.Settings.AboutMastodon.Title" = "About Mastodon";
"Scene.Settings.AboutMastodon.MoreSettings" = "Even More Settings";
"Scene.Settings.AboutMastodon.ContributeToMastodon" = "Contribute to Mastodon";
"Scene.Settings.AboutMastodon.PrivacyPolicy" = "PrivacyPolicy";
"Scene.Settings.AboutMastodon.CleaerMediaStorage" = "Clear Media Storage";
"Scene.SuggestionAccount.FollowAll" = "Follow all";
"Scene.SuggestionAccount.Title" = "Popular on Mastodon";
"Scene.Thread.BackTitle" = "Post";