Add localized strings (#365)
This commit is contained in:
parent
28749b5029
commit
18720a9a51
|
@ -206,16 +206,19 @@ extension DataSourceFacade {
|
|||
) async throws {
|
||||
switch action {
|
||||
case .hideReblogs(let actionContext):
|
||||
//FIXME: Add localized strings
|
||||
let title = actionContext.showReblogs ? L10n.Scene.Profile.RelationshipActionAlert.ConfirmHideReblogs.title : L10n.Scene.Profile.RelationshipActionAlert.ConfirmShowReblogs.title
|
||||
let message = actionContext.showReblogs ? L10n.Scene.Profile.RelationshipActionAlert.ConfirmHideReblogs.message : L10n.Scene.Profile.RelationshipActionAlert.ConfirmShowReblogs.message
|
||||
|
||||
let alertController = UIAlertController(
|
||||
title: actionContext.showReblogs ? "Really hide?" : "Really show?",
|
||||
message: actionContext.showReblogs ? "Really??" : "Really??",
|
||||
title: title,
|
||||
message: message,
|
||||
preferredStyle: .alert
|
||||
)
|
||||
|
||||
let actionTitle = actionContext.showReblogs ? L10n.Common.Controls.Friendship.hideReblogs : L10n.Common.Controls.Friendship.showReblogs
|
||||
let showHideReblogsAction = UIAlertAction(
|
||||
title: actionContext.showReblogs ? "Show" : "Hide",
|
||||
style: .default
|
||||
title: actionTitle,
|
||||
style: .destructive
|
||||
) { [weak dependency] _ in
|
||||
guard let dependency else { return }
|
||||
|
||||
|
@ -237,7 +240,7 @@ extension DataSourceFacade {
|
|||
|
||||
alertController.addAction(showHideReblogsAction)
|
||||
|
||||
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel)
|
||||
let cancelAction = UIAlertAction(title: L10n.Common.Controls.Actions.cancel, style: .cancel)
|
||||
alertController.addAction(cancelAction)
|
||||
|
||||
dependency.present(alertController, animated: true)
|
||||
|
|
|
@ -713,6 +713,12 @@ public enum L10n {
|
|||
/// Block Account
|
||||
public static let title = L10n.tr("Localizable", "Scene.Profile.RelationshipActionAlert.ConfirmBlockUser.Title")
|
||||
}
|
||||
public enum ConfirmHideReblogs {
|
||||
/// Confirm to hide reblogs
|
||||
public static let message = L10n.tr("Localizable", "Scene.Profile.RelationshipActionAlert.ConfirmHideReblogs.Message")
|
||||
/// Hide reblogs
|
||||
public static let title = L10n.tr("Localizable", "Scene.Profile.RelationshipActionAlert.ConfirmHideReblogs.Title")
|
||||
}
|
||||
public enum ConfirmMuteUser {
|
||||
/// Confirm to mute %@
|
||||
public static func message(_ p1: Any) -> String {
|
||||
|
@ -721,6 +727,12 @@ public enum L10n {
|
|||
/// Mute Account
|
||||
public static let title = L10n.tr("Localizable", "Scene.Profile.RelationshipActionAlert.ConfirmMuteUser.Title")
|
||||
}
|
||||
public enum ConfirmShowReblogs {
|
||||
/// Confirm to show reblogs
|
||||
public static let message = L10n.tr("Localizable", "Scene.Profile.RelationshipActionAlert.ConfirmShowReblogs.Message")
|
||||
/// Show Reblogs
|
||||
public static let title = L10n.tr("Localizable", "Scene.Profile.RelationshipActionAlert.ConfirmShowReblogs.Title")
|
||||
}
|
||||
public enum ConfirmUnblockUser {
|
||||
/// Confirm to unblock %@
|
||||
public static func message(_ p1: Any) -> String {
|
||||
|
|
|
@ -79,6 +79,7 @@ Please check your internet connection.";
|
|||
"Common.Controls.Friendship.UnmuteUser" = "Unmute %@";
|
||||
"Common.Controls.Friendship.HideReblogs" = "Hide Reblogs";
|
||||
"Common.Controls.Friendship.ShowReblogs" = "Show Reblogs";
|
||||
|
||||
"Common.Controls.Keyboard.Common.ComposeNewPost" = "Compose New Post";
|
||||
"Common.Controls.Keyboard.Common.OpenSettings" = "Open Settings";
|
||||
"Common.Controls.Keyboard.Common.ShowFavorites" = "Show Favorites";
|
||||
|
@ -264,6 +265,10 @@ uploaded to Mastodon.";
|
|||
"Scene.Profile.RelationshipActionAlert.ConfirmUnblockUser.Title" = "Unblock Account";
|
||||
"Scene.Profile.RelationshipActionAlert.ConfirmUnmuteUser.Message" = "Confirm to unmute %@";
|
||||
"Scene.Profile.RelationshipActionAlert.ConfirmUnmuteUser.Title" = "Unmute Account";
|
||||
"Scene.Profile.RelationshipActionAlert.ConfirmShowReblogs.Message" = "Confirm to show reblogs";
|
||||
"Scene.Profile.RelationshipActionAlert.ConfirmShowReblogs.Title" = "Show Reblogs";
|
||||
"Scene.Profile.RelationshipActionAlert.ConfirmHideReblogs.Message" = "Confirm to hide reblogs";
|
||||
"Scene.Profile.RelationshipActionAlert.ConfirmHideReblogs.Title" = "Hide reblogs";
|
||||
"Scene.Profile.SegmentedControl.About" = "About";
|
||||
"Scene.Profile.SegmentedControl.Media" = "Media";
|
||||
"Scene.Profile.SegmentedControl.Posts" = "Posts";
|
||||
|
|
|
@ -52,7 +52,7 @@ extension MastodonMenu {
|
|||
func build(delegate: MastodonMenuDelegate) -> BuiltAction {
|
||||
switch self {
|
||||
case .hideReblogs(let context):
|
||||
let title = context.showReblogs ? L10n.Common.Controls.Friendship.hideReblogs : L10n.Common.Controls.Friendship.hideReblogs
|
||||
let title = context.showReblogs ? L10n.Common.Controls.Friendship.hideReblogs : L10n.Common.Controls.Friendship.showReblogs
|
||||
let reblogAction = BuiltAction(
|
||||
title: title,
|
||||
image: UIImage(systemName: "arrow.2.squarepath")
|
||||
|
|
Loading…
Reference in New Issue