1
0
mirror of https://github.com/mastodon/mastodon-ios.git synced 2025-02-03 02:37:37 +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",
"block": "Block",
"block_user": "Block %s",
"block_domain": "Block %s",
"block_domain": "Block domain %s",
"unblock": "Unblock",
"unblock_user": "Unblock %s",
"blocked": "Blocked",
"domain_blocked": "Domain Blocked",
"mute": "Mute",
"mute_user": "Mute %s",
"unmute": "Unmute",
@ -603,6 +604,14 @@
"confirm_hide_reblogs": {
"title": "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": {

View File

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

View File

@ -216,6 +216,8 @@ public enum L10n {
public static func blockUser(_ p1: Any) -> String {
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
public static let editInfo = L10n.tr("Localizable", "Common.Controls.Friendship.EditInfo", fallback: "Edit Info")
/// Follow
@ -241,6 +243,10 @@ public enum L10n {
/// Unblock
public static let unblock = L10n.tr("Localizable", "Common.Controls.Friendship.Unblock", fallback: "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 {
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 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 {
/// Confirm to block %@
public static func message(_ p1: Any) -> String {
@ -981,6 +991,14 @@ public enum L10n {
/// 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 {
/// Confirm to unblock %@
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.BlockUser" = "Block %@";
"Common.Controls.Friendship.Blocked" = "Blocked";
"Common.Controls.Friendship.DomainBlocked" = "Domain Blocked";
"Common.Controls.Friendship.EditInfo" = "Edit Info";
"Common.Controls.Friendship.Follow" = "Follow";
"Common.Controls.Friendship.Following" = "Following";
@ -85,6 +86,7 @@ Please check your internet connection.";
"Common.Controls.Friendship.ShowReblogs" = "Show Reblogs";
"Common.Controls.Friendship.Unblock" = "Unblock";
"Common.Controls.Friendship.UnblockUser" = "Unblock %@";
"Common.Controls.Friendship.UnblockDomain" = "Unblock %@";
"Common.Controls.Friendship.Unmute" = "Unmute";
"Common.Controls.Friendship.UnmuteUser" = "Unmute %@";
"Common.Controls.Keyboard.Common.ComposeNewPost" = "Compose New Post";
@ -336,6 +338,9 @@ uploaded to Mastodon.";
"Scene.Profile.Header.FollowsYou" = "Follows You";
"Scene.Profile.RelationshipActionAlert.ConfirmBlockUser.Message" = "Confirm to block %@";
"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.Title" = "Hide Reblogs";
"Scene.Profile.RelationshipActionAlert.ConfirmMuteUser.Message" = "Confirm to mute %@";
@ -563,4 +568,4 @@ uploaded to Mastodon.";
"Widget.MultipleFollowers.ConfigurationDescription" = "Show number of followers for multiple accounts.";
"Widget.MultipleFollowers.ConfigurationDisplayName" = "Multiple followers";
"Widget.MultipleFollowers.MockUser.AccountName" = "another@follower.social";
"Widget.MultipleFollowers.MockUser.DisplayName" = "Another follower";
"Widget.MultipleFollowers.MockUser.DisplayName" = "Another follower";

View File

@ -202,12 +202,11 @@ extension MastodonMenu {
case .blockDomain(let context):
let title: String
let image: UIImage?
//TODO: Add localization
if context.isBlocking {
title = "Unblock \(context.domain)"
title = L10n.Common.Controls.Actions.unblockDomain(context.domain)
image = UIImage(systemName: "hand.raised.slash.fill")
} else {
title = "Block \(context.domain)"
title = L10n.Common.Controls.Actions.blockDomain(context.domain)
image = UIImage(systemName: "hand.raised.fill")
}
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 .updating: return " "
case .showReblogs: return " "
case .domainBlocking: return "Unblock domain"
case .domainBlocking: return L10n.Common.Controls.Friendship.domainBlocked
}
}
}