From 2e4ff59bc23815b950d843cde49ad9224115f220 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Sat, 17 Dec 2022 19:50:40 +0100 Subject: [PATCH] Add some localization here and there (#690) --- .../input/Base.lproj/app.json | 21 +++++++++++++++++-- Localization/app.json | 11 ++++++++++ .../PickServer/View/OnboardingNextView.swift | 2 +- .../Privacy/PrivacyTableViewController.swift | 11 ++++++---- .../MastodonServerRulesViewController.swift | 2 +- .../Generated/Strings.swift | 20 ++++++++++++++++++ .../Resources/Base.lproj/Localizable.strings | 8 ++++++- .../Resources/en.lproj/Localizable.strings | 8 ++++++- 8 files changed, 73 insertions(+), 10 deletions(-) diff --git a/Localization/StringsConvertor/input/Base.lproj/app.json b/Localization/StringsConvertor/input/Base.lproj/app.json index 073108aad..9bce07352 100644 --- a/Localization/StringsConvertor/input/Base.lproj/app.json +++ b/Localization/StringsConvertor/input/Base.lproj/app.json @@ -241,7 +241,21 @@ "welcome": { "slogan": "Social networking\nback in your hands.", "get_started": "Get Started", - "log_in": "Log In" + "log_in": "Log In", + "education": { + "what_is_mastodon": { + "title": "What is", + "description": "Imagine you have an email address that ends with @example.com.\n\nYou can still send and receive emails from anyone, even if their email ends in @gmail.com or @icloud.com or @example.com.", + }, + "mastodon_is_like_that": { + "title": "Mastodon is like that", + "description": "Your handle might be @gothgirl654@example.social, but you can still follow, reblog, and chat with @fallout5ever@example.online.", + }, + "how_do_i_pick_a_server": { + "title": "How do I pick a server?", + "description": "Different people choose different servers for any number of reasons. art.example is a great place for artists, while glasgow.example might be a good pick for Scots.\n\nYou can’t go wrong with any of our recommend servers, so regardless of which one you pick (or if you enter your own in the server search bar), you’ll never miss a beat anywhere.", + }, + } }, "login": { "title": "Welcome back", @@ -251,7 +265,7 @@ } }, "server_picker": { - "title": "Pick server", + "title": "Pick Server", "button": { "category": { "all": "All", @@ -286,6 +300,9 @@ "no_results": "No results" } }, + "privacy": { + "title": "Privacy" + } "register": { "title": "Let’s get you set up on %s", "lets_get_you_set_up_on_domain": "Let’s get you set up on %s", diff --git a/Localization/app.json b/Localization/app.json index af7c05a90..6f260274f 100644 --- a/Localization/app.json +++ b/Localization/app.json @@ -300,6 +300,17 @@ "no_results": "No results" } }, + "privacy": { + "title": "Privacy", + "policy": { + "ios": "Privacy Policy - Mastodon for iOS"; + "server" = "Privacy Policy - %s"; + + }, + "button": { + "confirm": "I agree" + } + } "register": { "title": "Let’s get you set up on %s", "lets_get_you_set_up_on_domain": "Let’s get you set up on %s", diff --git a/Mastodon/Scene/Onboarding/PickServer/View/OnboardingNextView.swift b/Mastodon/Scene/Onboarding/PickServer/View/OnboardingNextView.swift index e629c3466..ae124c088 100644 --- a/Mastodon/Scene/Onboarding/PickServer/View/OnboardingNextView.swift +++ b/Mastodon/Scene/Onboarding/PickServer/View/OnboardingNextView.swift @@ -40,7 +40,7 @@ final class OnboardingNextView: UIView { label.numberOfLines = 0 label.textColor = .secondaryLabel label.font = UIFontMetrics(forTextStyle: .footnote).scaledFont(for: .systemFont(ofSize: 13, weight: .regular)) - label.text = "We’ll pick a server based on your language if you continue without making a selection." //TODO: @zeitschlag localize + label.text = L10n.Scene.ServerPicker.noServerSelectedHint return label }() diff --git a/Mastodon/Scene/Onboarding/Privacy/PrivacyTableViewController.swift b/Mastodon/Scene/Onboarding/Privacy/PrivacyTableViewController.swift index d9542cd0b..903907b2d 100644 --- a/Mastodon/Scene/Onboarding/Privacy/PrivacyTableViewController.swift +++ b/Mastodon/Scene/Onboarding/Privacy/PrivacyTableViewController.swift @@ -8,7 +8,8 @@ import UIKit import MastodonCore import MastodonSDK -import SafariServices +import MastodonLocalization +import MastodonAsset enum PrivacyRow { case iOSApp @@ -26,9 +27,9 @@ enum PrivacyRow { var title: String { switch self { case .iOSApp: - return "Privacy Policy - Mastodon for iOS" + return L10n.Scene.Privacy.Policy.ios case .server(let domain): - return "Privacy Policy - \(domain)" + return L10n.Scene.Privacy.Policy.server(domain) } } } @@ -61,7 +62,9 @@ class PrivacyTableViewController: UIViewController, NeedsDependency { view.addSubview(tableView) setupConstraints() - navigationItem.rightBarButtonItem = UIBarButtonItem(title: "I agree", style: .done, target: self, action: #selector(PrivacyTableViewController.nextButtonPressed(_:))) + navigationItem.rightBarButtonItem = UIBarButtonItem(title: L10n.Scene.Privacy.Button.confirm, style: .done, target: self, action: #selector(PrivacyTableViewController.nextButtonPressed(_:))) + + title = L10n.Scene.Privacy.title } required init?(coder: NSCoder) { fatalError("init(coder:) won't been implemented, please don't use Storyboards.") } diff --git a/Mastodon/Scene/Onboarding/ServerRules/MastodonServerRulesViewController.swift b/Mastodon/Scene/Onboarding/ServerRules/MastodonServerRulesViewController.swift index b4f19f804..69e16fcc4 100644 --- a/Mastodon/Scene/Onboarding/ServerRules/MastodonServerRulesViewController.swift +++ b/Mastodon/Scene/Onboarding/ServerRules/MastodonServerRulesViewController.swift @@ -55,7 +55,7 @@ extension MastodonServerRulesViewController { viewModel.setupDiffableDataSource(tableView: tableView) - navigationItem.rightBarButtonItem = UIBarButtonItem(title: "I agree", style: .done, target: self, action: #selector(MastodonServerRulesViewController.nextButtonPressed(_:))) + navigationItem.rightBarButtonItem = UIBarButtonItem(title: L10n.Scene.ServerRules.Button.confirm, style: .done, target: self, action: #selector(MastodonServerRulesViewController.nextButtonPressed(_:))) title = L10n.Scene.ServerRules.title } diff --git a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift index 6b71dbf16..31903b2c1 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift +++ b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift @@ -791,6 +791,24 @@ public enum L10n { public static let showPrevious = L10n.tr("Localizable", "Scene.Preview.Keyboard.ShowPrevious", fallback: "Show Previous") } } + public enum Privacy { + /// Although the Mastodon app does not collect any data, the server you sign up through may have a different policy. Take a minute to review and agree to the Mastodon app privacy policy and your server’s privacy policy. + public static let description = L10n.tr("Localizable", "Scene.Privacy.Description", fallback: "Although the Mastodon app does not collect any data, the server you sign up through may have a different policy. Take a minute to review and agree to the Mastodon app privacy policy and your server’s privacy policy.") + /// Privacy + public static let title = L10n.tr("Localizable", "Scene.Privacy.Title", fallback: "Privacy") + public enum Button { + /// I agree + public static let confirm = L10n.tr("Localizable", "Scene.Privacy.Button.confirm", fallback: "I agree") + } + public enum Policy { + /// Privacy Policy - Mastodon for iOS + public static let ios = L10n.tr("Localizable", "Scene.Privacy.Policy.Ios", fallback: "Privacy Policy - Mastodon for iOS") + /// Privacy Policy - %@ + public static func server(_ p1: Any) -> String { + return L10n.tr("Localizable", "Scene.Privacy.Policy.Server", String(describing: p1), fallback: "Privacy Policy - %@") + } + } + } public enum Profile { public enum Accessibility { /// Double tap to open the list @@ -1186,6 +1204,8 @@ public enum L10n { } } public enum ServerPicker { + /// We’ll pick a server based on your language if you continue without making a selection. + public static let noServerSelectedHint = L10n.tr("Localizable", "Scene.ServerPicker.NoServerSelectedHint", fallback: "We’ll pick a server based on your language if you continue without making a selection.") /// Pick server public static let title = L10n.tr("Localizable", "Scene.ServerPicker.Title", fallback: "Pick server") public enum Button { diff --git a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings index 868dec89e..06ddb4776 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings +++ b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings @@ -436,6 +436,7 @@ uploaded to Mastodon."; "Scene.ServerPicker.Label.Language" = "LANGUAGE"; "Scene.ServerPicker.Label.Users" = "USERS"; "Scene.ServerPicker.Title" = "Pick server"; +"Scene.ServerPicker.NoServerSelectedHint" = "We’ll pick a server based on your language if you continue without making a selection."; "Scene.ServerRules.Button.Confirm" = "I Agree"; "Scene.ServerRules.PrivacyPolicy" = "privacy policy"; "Scene.ServerRules.Prompt" = "By continuing, you’re subject to the terms of service and privacy policy for %@."; @@ -497,4 +498,9 @@ You can still send and receive emails from anyone, even if their email ends in @ You can’t go wrong with any of our recommend servers, so regardless of which one you pick (or if you enter your own in the server search bar), you’ll never miss a beat anywhere."; "Scene.Wizard.AccessibilityHint" = "Double tap to dismiss this wizard"; "Scene.Wizard.MultipleAccountSwitchIntroDescription" = "Switch between multiple accounts by holding the profile button."; -"Scene.Wizard.NewInMastodon" = "New in Mastodon"; \ No newline at end of file +"Scene.Wizard.NewInMastodon" = "New in Mastodon"; +"Scene.Privacy.Title" = "Privacy"; +"Scene.Privacy.Description" = "Although the Mastodon app does not collect any data, the server you sign up through may have a different policy. Take a minute to review and agree to the Mastodon app privacy policy and your server’s privacy policy."; +"Scene.Privacy.Button.confirm" = "I agree"; +"Scene.Privacy.Policy.Ios" = "Privacy Policy - Mastodon for iOS"; +"Scene.Privacy.Policy.Server" = "Privacy Policy - %@"; diff --git a/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings b/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings index 5a07ceaea..349117ec5 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings +++ b/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings @@ -427,6 +427,7 @@ uploaded to Mastodon."; "Scene.ServerPicker.Label.Language" = "LANGUAGE"; "Scene.ServerPicker.Label.Users" = "USERS"; "Scene.ServerPicker.Title" = "Pick server"; +"Scene.ServerPicker.NoServerSelectedHint" = "We’ll pick a server based on your language if you continue without making a selection."; "Scene.ServerRules.Button.Confirm" = "I Agree"; "Scene.ServerRules.PrivacyPolicy" = "privacy policy"; "Scene.ServerRules.Prompt" = "By continuing, you’re subject to the terms of service and privacy policy for %@."; @@ -478,4 +479,9 @@ uploaded to Mastodon."; back in your hands."; "Scene.Wizard.AccessibilityHint" = "Double tap to dismiss this wizard"; "Scene.Wizard.MultipleAccountSwitchIntroDescription" = "Switch between multiple accounts by holding the profile button."; -"Scene.Wizard.NewInMastodon" = "New in Mastodon"; \ No newline at end of file +"Scene.Wizard.NewInMastodon" = "New in Mastodon"; +"Scene.Privacy.Title" = "Privacy"; +"Scene.Privacy.Description" = "Although the Mastodon app does not collect any data, the server you sign up through may have a different policy. Take a minute to review and agree to the Mastodon app privacy policy and your server’s privacy policy."; +"Scene.Privacy.Button.confirm" = "I agree"; +"Scene.Privacy.Policy.Ios" = "Privacy Policy - Mastodon for iOS"; +"Scene.Privacy.Policy.Server" = "Privacy Policy - %@";