Throw in some localization (IOS-284)

This commit is contained in:
Nathan Mattes 2024-06-30 18:54:47 +02:00
parent d972578176
commit f56d7ebaa8
5 changed files with 56 additions and 11 deletions

View File

@ -232,6 +232,11 @@
"edit_history": {
"title": "Edit History",
"original_post": "Original Post · %s"
},
"card": {
"publisher_date": "%s · %s",
"by": "By",
"by_author": "By %s"
}
},
"friendship": {
@ -751,6 +756,7 @@
"title": "Settings",
"general": "General",
"notifications": "Notifications",
"privacy_safety": "Privacy & Safety",
"support_mastodon": "Support Mastodon",
"about_mastodon": "About Mastodon",
"server_details": "Server Details",
@ -821,6 +827,25 @@
"go_to_settings": "Go to Notification Settings"
}
},
"privacy_safety": {
"title": "Privacy & Safety",
"preset": {
"title": "Preset",
"open_and_public": "Open & Public",
"private_and_restricted": "Private & Restricted",
"custom": "Custom"
},
"default_post_visibility": {
"title": "Default Post Visibility",
"public": "Public",
"followers_only": "Followers Only",
"only_people_mentioned": "Only People Mentioned"
},
"manually_approve_follow_requests": "Manually Approve Follow Requests",
"show_followers_and_following": "Show Followers & Following",
"suggest_my_account_to_others": "Suggest My Account to Others",
"appear_in_search_engines": "Appear in Search Engines"
}
},
"report": {

View File

@ -232,6 +232,11 @@
"edit_history": {
"title": "Edit History",
"original_post": "Original Post · %s"
},
"card": {
"publisher_date": "%s · %s",
"by": "By",
"by_author": "By %s"
}
},
"friendship": {

View File

@ -411,6 +411,18 @@ public enum L10n {
/// Boosts
public static let reblogsTitle = L10n.tr("Localizable", "Common.Controls.Status.Buttons.ReblogsTitle", fallback: "Boosts")
}
public enum Card {
/// By
public static let by = L10n.tr("Localizable", "Common.Controls.Status.Card.By", fallback: "By")
/// By %@
public static func byAuthor(_ p1: Any) -> String {
return L10n.tr("Localizable", "Common.Controls.Status.Card.ByAuthor", String(describing: p1), fallback: "By %@")
}
/// %@ · %@
public static func publisherDate(_ p1: Any, _ p2: Any) -> String {
return L10n.tr("Localizable", "Common.Controls.Status.Card.PublisherDate", String(describing: p1), String(describing: p2), fallback: "%@ · %@")
}
}
public enum EditHistory {
/// Original Post · %@
public static func originalPost(_ p1: Any) -> String {

View File

@ -136,6 +136,9 @@ Please check your internet connection.";
"Common.Controls.Status.Buttons.EditHistoryTitle" = "Edit History";
"Common.Controls.Status.Buttons.FavoritesTitle" = "Favorites";
"Common.Controls.Status.Buttons.ReblogsTitle" = "Boosts";
"Common.Controls.Status.Card.By" = "By";
"Common.Controls.Status.Card.ByAuthor" = "By %@";
"Common.Controls.Status.Card.PublisherDate" = "%@ · %@";
"Common.Controls.Status.ContentWarning" = "Content Warning";
"Common.Controls.Status.EditHistory.OriginalPost" = "Original Post · %@";
"Common.Controls.Status.EditHistory.Title" = "Edit History";
@ -562,19 +565,19 @@ If you disagree with the policy for **%@**, you can go back and pick a different
"Scene.Settings.Overview.ServerDetails" = "Server Details";
"Scene.Settings.Overview.SupportMastodon" = "Support Mastodon";
"Scene.Settings.Overview.Title" = "Settings";
"Scene.Settings.PrivacySafety.Title" = "Privacy & Safety";
"Scene.Settings.PrivacySafety.Preset.Title" = "Preset";
"Scene.Settings.PrivacySafety.Preset.OpenAndPublic" = "Open & Public";
"Scene.Settings.PrivacySafety.Preset.PrivateAndRestricted" = "Private & Restricted";
"Scene.Settings.PrivacySafety.Preset.Custom" = "Custom";
"Scene.Settings.PrivacySafety.DefaultPostVisibility.Title" = "Default Post Visibility";
"Scene.Settings.PrivacySafety.DefaultPostVisibility.Public" = "Public";
"Scene.Settings.PrivacySafety.AppearInSearchEngines" = "Appear in Search Engines";
"Scene.Settings.PrivacySafety.DefaultPostVisibility.FollowersOnly" = "Followers Only";
"Scene.Settings.PrivacySafety.DefaultPostVisibility.OnlyPeopleMentioned" = "Only People Mentioned";
"Scene.Settings.PrivacySafety.DefaultPostVisibility.Public" = "Public";
"Scene.Settings.PrivacySafety.DefaultPostVisibility.Title" = "Default Post Visibility";
"Scene.Settings.PrivacySafety.ManuallyApproveFollowRequests" = "Manually Approve Follow Requests";
"Scene.Settings.PrivacySafety.Preset.Custom" = "Custom";
"Scene.Settings.PrivacySafety.Preset.OpenAndPublic" = "Open & Public";
"Scene.Settings.PrivacySafety.Preset.PrivateAndRestricted" = "Private & Restricted";
"Scene.Settings.PrivacySafety.Preset.Title" = "Preset";
"Scene.Settings.PrivacySafety.ShowFollowersAndFollowing" = "Show Followers & Following";
"Scene.Settings.PrivacySafety.SuggestMyAccountToOthers" = "Suggest My Account to Others";
"Scene.Settings.PrivacySafety.AppearInSearchEngines" = "Appear in Search Engines";
"Scene.Settings.PrivacySafety.Title" = "Privacy & Safety";
"Scene.Settings.ServerDetails.About" = "About";
"Scene.Settings.ServerDetails.AboutInstance.LegalNotice" = "A legal notice";
"Scene.Settings.ServerDetails.AboutInstance.MessageAdmin" = "Message Admin";

View File

@ -227,9 +227,9 @@ public final class StatusCardControl: UIControl {
headerContentStackView.addGestureRecognizer(tapGestureRecognizer)
} else {
if let author = card.authors?.first, let authorName = author.name, authorName.isEmpty == false {
authorLabel.text = "by \(authorName)"
authorLabel.text = L10n.Common.Controls.Status.Card.byAuthor(authorName)
} else if let authorName = card.authorName, authorName.isEmpty == false {
authorLabel.text = "by \(authorName)"
authorLabel.text = L10n.Common.Controls.Status.Card.byAuthor(authorName)
} else {
authorLabel.text = url?.host
}