diff --git a/Localization/app.json b/Localization/app.json index d36af7781..9e94951d8 100644 --- a/Localization/app.json +++ b/Localization/app.json @@ -364,8 +364,8 @@ "no_server_selected_hint": "We’ll pick a server based on your language if you continue without making a selection." }, "privacy": { - "title": "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.", + "title": "Your Privacy", + "description": "Although the Mastodon app does not collect any data, the server you sign up through may have a different policy.\n\nIf you disagree with the policy for **%s**, you can go back and pick a different server.", "policy": { "ios": "Privacy Policy - Mastodon for iOS", "server": "Privacy Policy - %s" diff --git a/Mastodon/Scene/Onboarding/Privacy/PrivacyTableViewController.swift b/Mastodon/Scene/Onboarding/Privacy/PrivacyTableViewController.swift index 404db0bb4..79fb9e1bc 100644 --- a/Mastodon/Scene/Onboarding/Privacy/PrivacyTableViewController.swift +++ b/Mastodon/Scene/Onboarding/Privacy/PrivacyTableViewController.swift @@ -6,6 +6,7 @@ // import UIKit +import SwiftUI import MastodonCore import MastodonSDK import MastodonLocalization @@ -135,19 +136,22 @@ extension PrivacyTableViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { let wrapper = UIView() - - let label = UILabel() + let controller = UIHostingController( + rootView: HeaderTextView( + text: LocalizedStringKey(L10n.Scene.Privacy.description(viewModel.domain)) + ) + ) + guard let label = controller.view else { return nil } + addChild(controller) + label.backgroundColor = .clear label.translatesAutoresizingMaskIntoConstraints = false - label.numberOfLines = 0 - label.text = L10n.Scene.Privacy.description - label.textColor = Asset.Colors.Label.primary.color wrapper.addSubview(label) - + controller.didMove(toParent: self) NSLayoutConstraint.activate([ label.topAnchor.constraint(equalTo: wrapper.topAnchor, constant: 16), label.leadingAnchor.constraint(equalTo: wrapper.leadingAnchor), wrapper.trailingAnchor.constraint(equalTo: label.trailingAnchor), - wrapper.bottomAnchor.constraint(equalTo: label.bottomAnchor, constant: 16), + wrapper.bottomAnchor.constraint(equalTo: label.bottomAnchor, constant: 16) ]) return wrapper @@ -155,3 +159,14 @@ extension PrivacyTableViewController: UITableViewDelegate { } extension PrivacyTableViewController: OnboardingViewControllerAppearance { } + +private struct HeaderTextView: View { + let text: LocalizedStringKey + + var body: some View { + Text(text) + .fixedSize(horizontal: false, vertical: true) + .foregroundStyle(Asset.Colors.Label.primary.swiftUIColor) + .padding(.bottom, 16) + } +} diff --git a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift index 0f67b89dc..055335170 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift +++ b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift @@ -941,10 +941,14 @@ public enum L10n { } } 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") + /// Although the Mastodon app does not collect any data, the server you sign up through may have a different policy. + /// + /// If you disagree with the policy for **%@**, you can go back and pick a different server. + public static func description(_ p1: Any) -> String { + return L10n.tr("Localizable", "Scene.Privacy.Description", String(describing: p1), fallback: "Although the Mastodon app does not collect any data, the server you sign up through may have a different policy.\n\nIf you disagree with the policy for **%@**, you can go back and pick a different server.") + } + /// Your Privacy + public static let title = L10n.tr("Localizable", "Scene.Privacy.Title", fallback: "Your Privacy") public enum Button { /// I Agree public static let confirm = L10n.tr("Localizable", "Scene.Privacy.Button.Confirm", fallback: "I Agree") diff --git a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings index 0e613d62d..1216ca546 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings +++ b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings @@ -336,10 +336,10 @@ uploaded to Mastodon."; "Scene.Preview.Keyboard.ShowNext" = "Show Next"; "Scene.Preview.Keyboard.ShowPrevious" = "Show Previous"; "Scene.Privacy.Button.Confirm" = "I Agree"; -"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.Description" = "Although the Mastodon app does not collect any data, the server you sign up through may have a different policy.\n\nIf you disagree with the policy for **%@**, you can go back and pick a different server."; "Scene.Privacy.Policy.Ios" = "Privacy Policy - Mastodon for iOS"; "Scene.Privacy.Policy.Server" = "Privacy Policy - %@"; -"Scene.Privacy.Title" = "Privacy"; +"Scene.Privacy.Title" = "Your Privacy"; "Scene.Profile.Accessibility.DoubleTapToOpenTheList" = "Double tap to open the list"; "Scene.Profile.Accessibility.EditAvatarImage" = "Edit avatar image"; "Scene.Profile.Accessibility.ShowAvatarImage" = "Show avatar image"; diff --git a/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings b/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings index 430b4c0d9..ee14fe1e6 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings +++ b/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings @@ -325,10 +325,10 @@ uploaded to Mastodon."; "Scene.Preview.Keyboard.ShowNext" = "Show Next"; "Scene.Preview.Keyboard.ShowPrevious" = "Show Previous"; "Scene.Privacy.Button.Confirm" = "I Agree"; -"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.Description" = "Although the Mastodon app does not collect any data, the server you sign up through may have a different policy.\n\nIf you disagree with the policy for **%@**, you can go back and pick a different server."; "Scene.Privacy.Policy.Ios" = "Privacy Policy - Mastodon for iOS"; "Scene.Privacy.Policy.Server" = "Privacy Policy - %@"; -"Scene.Privacy.Title" = "Privacy"; +"Scene.Privacy.Title" = "Your Privacy"; "Scene.Profile.Accessibility.DoubleTapToOpenTheList" = "Double tap to open the list"; "Scene.Profile.Accessibility.EditAvatarImage" = "Edit avatar image"; "Scene.Profile.Accessibility.ShowAvatarImage" = "Show avatar image";