This commit is contained in:
Marcus Kida 2024-05-20 10:34:18 +02:00 committed by GitHub
commit 38270809f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 36 additions and 17 deletions

View File

@ -364,8 +364,8 @@
"no_server_selected_hint": "Well 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 servers 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"

View File

@ -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)
}
}

View File

@ -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 servers 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 servers 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")

View File

@ -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 servers 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";

View File

@ -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 servers 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";