1
0
mirror of https://github.com/mastodon/mastodon-ios.git synced 2025-02-03 10:47:35 +01:00

Localize Domain Block (IOS-5)

This commit is contained in:
Nathan Mattes 2023-12-19 13:12:32 +01:00
parent 8b02ba29dd
commit 4322607552
6 changed files with 44 additions and 13 deletions

View File

@ -222,10 +222,11 @@
"pending": "Pending", "pending": "Pending",
"block": "Block", "block": "Block",
"block_user": "Block %s", "block_user": "Block %s",
"block_domain": "Block %s", "block_domain": "Block domain %s",
"unblock": "Unblock", "unblock": "Unblock",
"unblock_user": "Unblock %s", "unblock_user": "Unblock %s",
"blocked": "Blocked", "blocked": "Blocked",
"domain_blocked": "Domain Blocked",
"mute": "Mute", "mute": "Mute",
"mute_user": "Mute %s", "mute_user": "Mute %s",
"unmute": "Unmute", "unmute": "Unmute",
@ -603,6 +604,14 @@
"confirm_hide_reblogs": { "confirm_hide_reblogs": {
"title": "Hide Reblogs", "title": "Hide Reblogs",
"message": "Confirm to hide reblogs" "message": "Confirm to hide reblogs"
},
"confirm_block_domain": {
"title": "Block domain",
"message": "Confirm to block domain %s"
},
"confirm_unblock_domain": {
"title": "Unblock domain",
"message": "Confirm to unblock domain %s"
} }
}, },
"accessibility": { "accessibility": {

View File

@ -399,16 +399,16 @@ extension DataSourceFacade {
let message: String let message: String
let actionTitle: String let actionTitle: String
#warning("Localization")
if context.isBlocking { if context.isBlocking {
title = "Unblock \(context.domain)" title = L10n.Scene.Profile.RelationshipActionAlert.ConfirmUnblockDomain.title
message = "Really unblock \(context.domain)" message = L10n.Scene.Profile.RelationshipActionAlert.ConfirmUnblockDomain.message(context.domain)
actionTitle = L10n.Common.Controls.Friendship.unblockUser(context.domain) actionTitle = L10n.Common.Controls.Friendship.unblockDomain(context.domain)
} else { } else {
title = "Block \(context.domain)" title = L10n.Scene.Profile.RelationshipActionAlert.ConfirmBlockDomain.title
message = "Really block \(context.domain)" message = L10n.Common.Alerts.BlockDomain.title(context.domain)
actionTitle = L10n.Common.Controls.Friendship.blockUser(context.domain) actionTitle = L10n.Common.Alerts.BlockDomain.blockEntireDomain
} }
let alertController = UIAlertController( let alertController = UIAlertController(
title: title, title: title,
message: message, message: message,

View File

@ -216,6 +216,8 @@ public enum L10n {
public static func blockUser(_ p1: Any) -> String { public static func blockUser(_ p1: Any) -> String {
return L10n.tr("Localizable", "Common.Controls.Friendship.BlockUser", String(describing: p1), fallback: "Block %@") return L10n.tr("Localizable", "Common.Controls.Friendship.BlockUser", String(describing: p1), fallback: "Block %@")
} }
/// Domain Blocked
public static let domainBlocked = L10n.tr("Localizable", "Common.Controls.Friendship.DomainBlocked", fallback: "Domain Blocked")
/// Edit Info /// Edit Info
public static let editInfo = L10n.tr("Localizable", "Common.Controls.Friendship.EditInfo", fallback: "Edit Info") public static let editInfo = L10n.tr("Localizable", "Common.Controls.Friendship.EditInfo", fallback: "Edit Info")
/// Follow /// Follow
@ -241,6 +243,10 @@ public enum L10n {
/// Unblock /// Unblock
public static let unblock = L10n.tr("Localizable", "Common.Controls.Friendship.Unblock", fallback: "Unblock") public static let unblock = L10n.tr("Localizable", "Common.Controls.Friendship.Unblock", fallback: "Unblock")
/// Unblock %@ /// Unblock %@
public static func unblockDomain(_ p1: Any) -> String {
return L10n.tr("Localizable", "Common.Controls.Friendship.UnblockDomain", String(describing: p1), fallback: "Unblock %@")
}
/// Unblock %@
public static func unblockUser(_ p1: Any) -> String { public static func unblockUser(_ p1: Any) -> String {
return L10n.tr("Localizable", "Common.Controls.Friendship.UnblockUser", String(describing: p1), fallback: "Unblock %@") return L10n.tr("Localizable", "Common.Controls.Friendship.UnblockUser", String(describing: p1), fallback: "Unblock %@")
} }
@ -953,6 +959,10 @@ public enum L10n {
public static let followsYou = L10n.tr("Localizable", "Scene.Profile.Header.FollowsYou", fallback: "Follows You") public static let followsYou = L10n.tr("Localizable", "Scene.Profile.Header.FollowsYou", fallback: "Follows You")
} }
public enum RelationshipActionAlert { public enum RelationshipActionAlert {
public enum ConfirmBlockDomain {
/// Block Domain
public static let title = L10n.tr("Localizable", "Scene.Profile.RelationshipActionAlert.ConfirmBlockDomain.Title", fallback: "Block Domain")
}
public enum ConfirmBlockUser { public enum ConfirmBlockUser {
/// Confirm to block %@ /// Confirm to block %@
public static func message(_ p1: Any) -> String { public static func message(_ p1: Any) -> String {
@ -981,6 +991,14 @@ public enum L10n {
/// Show Reblogs /// Show Reblogs
public static let title = L10n.tr("Localizable", "Scene.Profile.RelationshipActionAlert.ConfirmShowReblogs.Title", fallback: "Show Reblogs") public static let title = L10n.tr("Localizable", "Scene.Profile.RelationshipActionAlert.ConfirmShowReblogs.Title", fallback: "Show Reblogs")
} }
public enum ConfirmUnblockDomain {
/// Confirm to unblock domain %@
public static func message(_ p1: Any) -> String {
return L10n.tr("Localizable", "Scene.Profile.RelationshipActionAlert.ConfirmUnblockDomain.Message", String(describing: p1), fallback: "Confirm to unblock domain %@")
}
/// Unblock Domain
public static let title = L10n.tr("Localizable", "Scene.Profile.RelationshipActionAlert.ConfirmUnblockDomain.Title", fallback: "Unblock Domain")
}
public enum ConfirmUnblockUser { public enum ConfirmUnblockUser {
/// Confirm to unblock %@ /// Confirm to unblock %@
public static func message(_ p1: Any) -> String { public static func message(_ p1: Any) -> String {

View File

@ -73,6 +73,7 @@ Please check your internet connection.";
"Common.Controls.Friendship.BlockDomain" = "Block %@"; "Common.Controls.Friendship.BlockDomain" = "Block %@";
"Common.Controls.Friendship.BlockUser" = "Block %@"; "Common.Controls.Friendship.BlockUser" = "Block %@";
"Common.Controls.Friendship.Blocked" = "Blocked"; "Common.Controls.Friendship.Blocked" = "Blocked";
"Common.Controls.Friendship.DomainBlocked" = "Domain Blocked";
"Common.Controls.Friendship.EditInfo" = "Edit Info"; "Common.Controls.Friendship.EditInfo" = "Edit Info";
"Common.Controls.Friendship.Follow" = "Follow"; "Common.Controls.Friendship.Follow" = "Follow";
"Common.Controls.Friendship.Following" = "Following"; "Common.Controls.Friendship.Following" = "Following";
@ -85,6 +86,7 @@ Please check your internet connection.";
"Common.Controls.Friendship.ShowReblogs" = "Show Reblogs"; "Common.Controls.Friendship.ShowReblogs" = "Show Reblogs";
"Common.Controls.Friendship.Unblock" = "Unblock"; "Common.Controls.Friendship.Unblock" = "Unblock";
"Common.Controls.Friendship.UnblockUser" = "Unblock %@"; "Common.Controls.Friendship.UnblockUser" = "Unblock %@";
"Common.Controls.Friendship.UnblockDomain" = "Unblock %@";
"Common.Controls.Friendship.Unmute" = "Unmute"; "Common.Controls.Friendship.Unmute" = "Unmute";
"Common.Controls.Friendship.UnmuteUser" = "Unmute %@"; "Common.Controls.Friendship.UnmuteUser" = "Unmute %@";
"Common.Controls.Keyboard.Common.ComposeNewPost" = "Compose New Post"; "Common.Controls.Keyboard.Common.ComposeNewPost" = "Compose New Post";
@ -336,6 +338,9 @@ uploaded to Mastodon.";
"Scene.Profile.Header.FollowsYou" = "Follows You"; "Scene.Profile.Header.FollowsYou" = "Follows You";
"Scene.Profile.RelationshipActionAlert.ConfirmBlockUser.Message" = "Confirm to block %@"; "Scene.Profile.RelationshipActionAlert.ConfirmBlockUser.Message" = "Confirm to block %@";
"Scene.Profile.RelationshipActionAlert.ConfirmBlockUser.Title" = "Block Account"; "Scene.Profile.RelationshipActionAlert.ConfirmBlockUser.Title" = "Block Account";
"Scene.Profile.RelationshipActionAlert.ConfirmBlockDomain.Title" = "Block Domain";
"Scene.Profile.RelationshipActionAlert.ConfirmUnblockDomain.Message" = "Confirm to unblock domain %@";
"Scene.Profile.RelationshipActionAlert.ConfirmUnblockDomain.Title" = "Unblock Domain";
"Scene.Profile.RelationshipActionAlert.ConfirmHideReblogs.Message" = "Confirm to hide reblogs"; "Scene.Profile.RelationshipActionAlert.ConfirmHideReblogs.Message" = "Confirm to hide reblogs";
"Scene.Profile.RelationshipActionAlert.ConfirmHideReblogs.Title" = "Hide Reblogs"; "Scene.Profile.RelationshipActionAlert.ConfirmHideReblogs.Title" = "Hide Reblogs";
"Scene.Profile.RelationshipActionAlert.ConfirmMuteUser.Message" = "Confirm to mute %@"; "Scene.Profile.RelationshipActionAlert.ConfirmMuteUser.Message" = "Confirm to mute %@";

View File

@ -202,12 +202,11 @@ extension MastodonMenu {
case .blockDomain(let context): case .blockDomain(let context):
let title: String let title: String
let image: UIImage? let image: UIImage?
//TODO: Add localization
if context.isBlocking { if context.isBlocking {
title = "Unblock \(context.domain)" title = L10n.Common.Controls.Actions.unblockDomain(context.domain)
image = UIImage(systemName: "hand.raised.slash.fill") image = UIImage(systemName: "hand.raised.slash.fill")
} else { } else {
title = "Block \(context.domain)" title = L10n.Common.Controls.Actions.blockDomain(context.domain)
image = UIImage(systemName: "hand.raised.fill") image = UIImage(systemName: "hand.raised.fill")
} }
let action = LabeledAction(title: title, image: image) { [weak delegate] in let action = LabeledAction(title: title, image: image) { [weak delegate] in

View File

@ -94,7 +94,7 @@ public struct RelationshipActionOptionSet: OptionSet {
case .editing: return L10n.Common.Controls.Actions.done case .editing: return L10n.Common.Controls.Actions.done
case .updating: return " " case .updating: return " "
case .showReblogs: return " " case .showReblogs: return " "
case .domainBlocking: return "Unblock domain" case .domainBlocking: return L10n.Common.Controls.Friendship.domainBlocked
} }
} }
} }