Simplify strings

This commit is contained in:
Justin Mazzocchi 2020-11-22 12:20:36 -08:00
parent ad4e699ce1
commit 6e7541f208
No known key found for this signature in database
GPG key ID: E223E6937AAFB01C
3 changed files with 16 additions and 30 deletions

View file

@ -1,19 +1,19 @@
// Copyright © 2020 Metabolist. All rights reserved.
"account.block-account" = "Block %@";
"account.block" = "Block";
"account.field.verified" = "Verified %@";
"account.follow" = "Follow";
"account.following" = "Following";
"account.hide-reblogs-account" = "Hide reblogs from %@";
"account.mute-account" = "Mute %@";
"account.hide-reblogs" = "Hide boosts";
"account.mute" = "Mute";
"account.request" = "Request";
"account.statuses" = "Posts";
"account.statuses-and-replies" = "Posts & Replies";
"account.media" = "Media";
"account.show-reblogs-account" = "Show reblogs from %@";
"account.unblock-account" = "Unblock %@";
"account.unfollow-account" = "Unfollow %@";
"account.unmute-account" = "Unmute %@";
"account.show-reblogs" = "Show boosts";
"account.unblock" = "Unblock";
"account.unfollow" = "Unfollow";
"account.unmute" = "Unmute";
"add" = "Add";
"apns-default-message" = "New notification";
"add-identity.instance-url" = "Instance URL";

View file

@ -66,24 +66,19 @@ final class ProfileViewController: TableViewController {
}
private extension ProfileViewController {
// swiftlint:disable:next function_body_length
func menu(accountViewModel: AccountViewModel, relationship: Relationship) -> UIMenu {
var actions = [UIAction]()
if relationship.following {
if relationship.showingReblogs {
actions.append(UIAction(
title: String.localizedStringWithFormat(
NSLocalizedString("account.hide-reblogs-account", comment: ""),
accountViewModel.accountName),
title: NSLocalizedString("account.hide-reblogs", comment: ""),
image: UIImage(systemName: "arrow.2.squarepath")) { _ in
accountViewModel.hideReblogs()
})
} else {
actions.append(UIAction(
title: String.localizedStringWithFormat(
NSLocalizedString("account.show-reblogs-account", comment: ""),
accountViewModel.accountName),
title: NSLocalizedString("account.show-reblogs", comment: ""),
image: UIImage(systemName: "arrow.2.squarepath")) { _ in
accountViewModel.showReblogs()
})
@ -92,17 +87,13 @@ private extension ProfileViewController {
if relationship.muting {
actions.append(UIAction(
title: String.localizedStringWithFormat(
NSLocalizedString("account.unmute-account", comment: ""),
accountViewModel.accountName),
title: NSLocalizedString("account.unmute", comment: ""),
image: UIImage(systemName: "speaker")) { _ in
accountViewModel.unmute()
})
} else {
actions.append(UIAction(
title: String.localizedStringWithFormat(
NSLocalizedString("account.mute-account", comment: ""),
accountViewModel.accountName),
title: NSLocalizedString("account.mute", comment: ""),
image: UIImage(systemName: "speaker.slash")) { _ in
accountViewModel.mute()
})
@ -110,18 +101,15 @@ private extension ProfileViewController {
if relationship.blocking {
actions.append(UIAction(
title: String.localizedStringWithFormat(
NSLocalizedString("account.unblock-account", comment: ""),
accountViewModel.accountName),
title: NSLocalizedString("account.unblock", comment: ""),
image: UIImage(systemName: "slash.circle")) { _ in
accountViewModel.unblock()
})
} else {
actions.append(UIAction(
title: String.localizedStringWithFormat(
NSLocalizedString("account.block-account", comment: ""),
accountViewModel.accountName),
image: UIImage(systemName: "slash.circle")) { _ in
title: NSLocalizedString("account.block", comment: ""),
image: UIImage(systemName: "slash.circle"),
attributes: .destructive) { _ in
accountViewModel.block()
})
}

View file

@ -212,9 +212,7 @@ private extension AccountHeaderView {
guard let accountViewModel = self?.viewModel?.accountViewModel else { return }
let unfollowAction = UIAction(
title: String.localizedStringWithFormat(
NSLocalizedString("account.unfollow-account", comment: ""),
accountViewModel.accountName),
title: NSLocalizedString("account.unfollow", comment: ""),
image: UIImage(systemName: "person.badge.minus"),
attributes: .destructive) { _ in
accountViewModel.unfollow()