From 675de4284bf33299baac0544569a96e58ece5265 Mon Sep 17 00:00:00 2001 From: Justin Mazzocchi <2831158+jzzocc@users.noreply.github.com> Date: Tue, 23 Mar 2021 18:39:04 -0700 Subject: [PATCH] Re-key strings for future SwiftUI use --- Localizations/de.lproj/Localizable.strings | 16 ++++++++-------- Localizations/de.lproj/Localizable.stringsdict | 12 ++++++------ Localizations/en.lproj/Localizable.strings | 16 ++++++++-------- Localizations/en.lproj/Localizable.stringsdict | 12 ++++++------ Localizations/ja.lproj/Localizable.strings | 16 ++++++++-------- Localizations/ja.lproj/Localizable.stringsdict | 12 ++++++------ Views/UIKit/AccountFieldView.swift | 4 ++-- Views/UIKit/AccountHeaderView.swift | 4 ++-- Views/UIKit/Content Views/NotificationView.swift | 8 ++++---- Views/UIKit/Content Views/StatusView.swift | 12 ++++++------ Views/UIKit/Content Views/TagView.swift | 2 +- Views/UIKit/PollView.swift | 4 ++-- 12 files changed, 59 insertions(+), 59 deletions(-) diff --git a/Localizations/de.lproj/Localizable.strings b/Localizations/de.lproj/Localizable.strings index 86eda78..7e854ae 100644 --- a/Localizations/de.lproj/Localizable.strings +++ b/Localizations/de.lproj/Localizable.strings @@ -22,10 +22,10 @@ "account.domain-block.confirm-%@" = "Sperre Domain %@?"; "account.domain-unblock-%@" = "Entsperre Domain %@"; "account.domain-unblock.confirm-%@" = "Entsperre Domain %@?"; -"account.field.verified" = "Verifiziere %@"; +"account.field.verified-%@" = "Verifiziere %@"; "account.follow" = "Folgen"; "account.following" = "Folgen"; -"account.following-count" = "%ld werden gefolgt"; +"account.following-count-%ld" = "%ld werden gefolgt"; "account.followed-by-%@" = "Gefolgt von %@"; "account.follows-you" = "Folgt dir"; "account.header.accessibility-label-%@" = "Banner: %@"; @@ -264,12 +264,12 @@ "more-results.statuses.toot" = "Mehr Toots"; "more-results.tags" = "Mehr Hashtags"; "notifications" = "Benachrichtungen"; -"notifications.reblogged-your-status" = "%@ boosteten Ihren Beitrag"; -"notifications.favourited-your-status" = "%@ favorisierten ihren Beitrag"; -"notifications.followed-you" = "%@ folgten ihnen"; +"notifications.reblogged-your-status-%@" = "%@ boosteten Ihren Beitrag"; +"notifications.favourited-your-status-%@" = "%@ favorisierten ihren Beitrag"; +"notifications.followed-you-%@" = "%@ folgten ihnen"; "notifications.poll-ended" = "Eine Umfrage, an der Sie teilgenommen haben, wurde beendet"; "notifications.your-poll-ended" = "Ihre Umfrage ist beendet"; -"notifications.unknown" = "Benachrichtigung von %@"; +"notifications.unknown-%@" = "Benachrichtigung von %@"; "remove" = "Entfernen"; "report" = "Melden"; "report.additional-comments" = "Zusätzliche Anmerkungen"; @@ -308,10 +308,10 @@ "status.poll.accessibility-label" = "Umfrage"; "status.poll.option-%ld" = "Option %ld"; "status.poll.vote" = "Wählen"; -"status.poll.time-left" = "%@ übrig"; +"status.poll.time-left-%@" = "%@ übrig"; "status.poll.refresh" = "Neuladen"; "status.poll.closed" = "Geschlossen"; -"status.reblogged-by" = "%@ boosted"; +"status.reblogged-by-%@" = "%@ boosted"; "status.reply-button.accessibility-label" = "Antworten"; "status.reblog-button.accessibility-label" = "Boost"; "status.reblog-button.undo.accessibility-label" = "Unboost"; diff --git a/Localizations/de.lproj/Localizable.stringsdict b/Localizations/de.lproj/Localizable.stringsdict index a21b4be..e91a306 100644 --- a/Localizations/de.lproj/Localizable.stringsdict +++ b/Localizations/de.lproj/Localizable.stringsdict @@ -2,7 +2,7 @@ - tag.people-talking + tag.people-talking-%ld NSStringLocalizedFormatKey %#@people@ @@ -18,7 +18,7 @@ %ld Personen sprechen drüber - status.poll.participation-count + status.poll.participation-count-%ld NSStringLocalizedFormatKey %#@people@ @@ -34,7 +34,7 @@ %ld Leute - status.reblogs-count + status.reblogs-count-%ld NSStringLocalizedFormatKey %#@reblogs@ @@ -50,7 +50,7 @@ %ld Boosts - status.favorites-count + status.favorites-count-%ld NSStringLocalizedFormatKey %#@favorites@ @@ -66,7 +66,7 @@ %ld Favoriten - status.replies-count + status.replies-count-%ld NSStringLocalizedFormatKey %#@replies@ @@ -114,7 +114,7 @@ %ld Toots - account.followers-count + account.followers-count-%ld NSStringLocalizedFormatKey %#@followers@ diff --git a/Localizations/en.lproj/Localizable.strings b/Localizations/en.lproj/Localizable.strings index 751d2d6..1c6c5fa 100644 --- a/Localizations/en.lproj/Localizable.strings +++ b/Localizations/en.lproj/Localizable.strings @@ -22,10 +22,10 @@ "account.domain-block.confirm-%@" = "Block domain %@?"; "account.domain-unblock-%@" = "Unblock domain %@"; "account.domain-unblock.confirm-%@" = "Unblock domain %@?"; -"account.field.verified" = "Verified %@"; +"account.field.verified-%@" = "Verified %@"; "account.follow" = "Follow"; "account.following" = "Following"; -"account.following-count" = "%ld Following"; +"account.following-count-%ld" = "%ld Following"; "account.followed-by-%@" = "Followed by %@"; "account.follows-you" = "Follows you"; "account.header.accessibility-label-%@" = "Header image: %@"; @@ -265,12 +265,12 @@ "more-results.statuses.toot" = "More toots"; "more-results.tags" = "More hashtags"; "notifications" = "Notifications"; -"notifications.reblogged-your-status" = "%@ boosted your status"; -"notifications.favourited-your-status" = "%@ favorited your status"; -"notifications.followed-you" = "%@ followed you"; +"notifications.reblogged-your-status-%@" = "%@ boosted your status"; +"notifications.favourited-your-status-%@" = "%@ favorited your status"; +"notifications.followed-you-%@" = "%@ followed you"; "notifications.poll-ended" = "A poll you have voted in has ended"; "notifications.your-poll-ended" = "Your poll has ended"; -"notifications.unknown" = "Notification from %@"; +"notifications.unknown-%@" = "Notification from %@"; "remove" = "Remove"; "report" = "Report"; "report.additional-comments" = "Additional comments"; @@ -309,10 +309,10 @@ "status.poll.accessibility-label" = "Poll"; "status.poll.option-%ld" = "Option %ld"; "status.poll.vote" = "Vote"; -"status.poll.time-left" = "%@ left"; +"status.poll.time-left-%@" = "%@ left"; "status.poll.refresh" = "Refresh"; "status.poll.closed" = "Closed"; -"status.reblogged-by" = "%@ boosted"; +"status.reblogged-by-%@" = "%@ boosted"; "status.reply-button.accessibility-label" = "Reply"; "status.reblog-button.accessibility-label" = "Boost"; "status.reblog-button.undo.accessibility-label" = "Unboost"; diff --git a/Localizations/en.lproj/Localizable.stringsdict b/Localizations/en.lproj/Localizable.stringsdict index 1f0ca01..2cef6d1 100644 --- a/Localizations/en.lproj/Localizable.stringsdict +++ b/Localizations/en.lproj/Localizable.stringsdict @@ -2,7 +2,7 @@ - tag.people-talking + tag.people-talking-%ld NSStringLocalizedFormatKey %#@people@ @@ -18,7 +18,7 @@ %ld people talking - status.poll.participation-count + status.poll.participation-count-%ld NSStringLocalizedFormatKey %#@people@ @@ -34,7 +34,7 @@ %ld people - status.reblogs-count + status.reblogs-count-%ld NSStringLocalizedFormatKey %#@reblogs@ @@ -50,7 +50,7 @@ %ld Boosts - status.favorites-count + status.favorites-count-%ld NSStringLocalizedFormatKey %#@favorites@ @@ -66,7 +66,7 @@ %ld Favorites - status.replies-count + status.replies-count-%ld NSStringLocalizedFormatKey %#@replies@ @@ -114,7 +114,7 @@ %ld Toots - account.followers-count + account.followers-count-%ld NSStringLocalizedFormatKey %#@followers@ diff --git a/Localizations/ja.lproj/Localizable.strings b/Localizations/ja.lproj/Localizable.strings index fc5903d..b9610ad 100644 --- a/Localizations/ja.lproj/Localizable.strings +++ b/Localizations/ja.lproj/Localizable.strings @@ -22,10 +22,10 @@ "account.domain-block.confirm-%@" = "%@をドメインブロックしますか?"; "account.domain-unblock-%@" = "%@をドメインブロック解除"; "account.domain-unblock.confirm-%@" = "%@をドメインブロック解除しますか?"; -"account.field.verified" = "%@は検証されています"; +"account.field.verified-%@" = "%@は検証されています"; "account.follow" = "フォロー"; "account.following" = "フォロー中"; -"account.following-count" = "%ld フォロー"; +"account.following-count-%ld" = "%ld フォロー"; "account.followed-by-%@" = "%@にフォローされています"; "account.follows-you" = "あなたをフォロー"; "account.header.accessibility-label-%@" = "ヘッダー画像: %@"; @@ -265,12 +265,12 @@ "more-results.statuses.toot" = "もっとトゥートを表示"; "more-results.tags" = "もっとハッシュタグを表示"; "notifications" = "通知"; -"notifications.reblogged-your-status" = "%@があなたのステータスをブーストしました"; -"notifications.favourited-your-status" = "%@があなたのステータスをお気に入りしました"; -"notifications.followed-you" = "%@があなたをフォローしました"; +"notifications.reblogged-your-status-%@" = "%@があなたのステータスをブーストしました"; +"notifications.favourited-your-status-%@" = "%@があなたのステータスをお気に入りしました"; +"notifications.followed-you-%@" = "%@があなたをフォローしました"; "notifications.poll-ended" = "あなたが投票したアンケートが終了しました"; "notifications.your-poll-ended" = "アンケートが終了しました"; -"notifications.unknown" = "%@からの通知"; +"notifications.unknown-%@" = "%@からの通知"; "remove" = "削除"; "report" = "通報"; "report.additional-comments" = "追加コメント"; @@ -309,10 +309,10 @@ "status.poll.accessibility-label" = "アンケート"; "status.poll.option-%ld" = "オプション %ld"; "status.poll.vote" = "投票"; -"status.poll.time-left" = "残り%@"; +"status.poll.time-left-%@" = "残り%@"; "status.poll.refresh" = "更新"; "status.poll.closed" = "終了"; -"status.reblogged-by" = "%@さんがブースト"; +"status.reblogged-by-%@" = "%@さんがブースト"; "status.reply-button.accessibility-label" = "返信する"; "status.reblog-button.accessibility-label" = "ブーストする"; "status.reblog-button.undo.accessibility-label" = "ブーストを解除する"; diff --git a/Localizations/ja.lproj/Localizable.stringsdict b/Localizations/ja.lproj/Localizable.stringsdict index 1e2d8c0..7b0d1fd 100644 --- a/Localizations/ja.lproj/Localizable.stringsdict +++ b/Localizations/ja.lproj/Localizable.stringsdict @@ -2,7 +2,7 @@ - tag.people-talking + tag.people-talking-%ld NSStringLocalizedFormatKey %#@people@ @@ -16,7 +16,7 @@ %ld 人が話題 - status.poll.participation-count + status.poll.participation-count-%ld NSStringLocalizedFormatKey %#@people@ @@ -30,7 +30,7 @@ %ld 人 - status.reblogs-count + status.reblogs-count-%ld NSStringLocalizedFormatKey %#@reblogs@ @@ -44,7 +44,7 @@ %ld ブースト - status.favorites-count + status.favorites-count-%ld NSStringLocalizedFormatKey %#@favorites@ @@ -58,7 +58,7 @@ %ld お気に入り - status.replies-count + status.replies-count-%ld NSStringLocalizedFormatKey %#@replies@ @@ -100,7 +100,7 @@ %ld トゥート - account.followers-count + account.followers-count-%ld NSStringLocalizedFormatKey %#@followers@ diff --git a/Views/UIKit/AccountFieldView.swift b/Views/UIKit/AccountFieldView.swift index 7966b80..e44a393 100644 --- a/Views/UIKit/AccountFieldView.swift +++ b/Views/UIKit/AccountFieldView.swift @@ -101,7 +101,7 @@ final class AccountFieldView: UIView { if let verifiedAt = verifiedAt { checkButton.menu = UIMenu( title: String.localizedStringWithFormat( - NSLocalizedString("account.field.verified", comment: ""), + NSLocalizedString("account.field.verified-%@", comment: ""), Self.dateFormatter.string(from: verifiedAt)), options: .displayInline, children: [UIAction(title: NSLocalizedString("ok", comment: "")) { _ in }]) @@ -156,7 +156,7 @@ final class AccountFieldView: UIView { if let verifiedAt = verifiedAt { accessibilityAttributedLabel.appendWithSeparator( String.localizedStringWithFormat( - NSLocalizedString("account.field.verified", comment: ""), + NSLocalizedString("account.field.verified-%@", comment: ""), Self.dateFormatter.string(from: verifiedAt))) } diff --git a/Views/UIKit/AccountHeaderView.swift b/Views/UIKit/AccountHeaderView.swift index 6bd2490..d1bf08e 100644 --- a/Views/UIKit/AccountHeaderView.swift +++ b/Views/UIKit/AccountHeaderView.swift @@ -186,10 +186,10 @@ final class AccountHeaderView: UIView { noteTextView.isHidden = false followingButton.setAttributedLocalizedTitle( - localizationKey: "account.following-count", + localizationKey: "account.following-count-%ld", count: accountViewModel.followingCount) followersButton.setAttributedLocalizedTitle( - localizationKey: "account.followers-count", + localizationKey: "account.followers-count-%ld", count: accountViewModel.followersCount) followStackView.isHidden = false } else { diff --git a/Views/UIKit/Content Views/NotificationView.swift b/Views/UIKit/Content Views/NotificationView.swift index 4049ff3..0e29641 100644 --- a/Views/UIKit/Content Views/NotificationView.swift +++ b/Views/UIKit/Content Views/NotificationView.swift @@ -170,21 +170,21 @@ private extension NotificationView { switch viewModel.type { case .follow: - typeLabel.attributedText = "notifications.followed-you".localizedBolding( + typeLabel.attributedText = "notifications.followed-you-%@".localizedBolding( displayName: viewModel.accountViewModel.displayName, emojis: viewModel.accountViewModel.emojis, label: typeLabel, identityContext: viewModel.identityContext) iconImageView.tintColor = nil case .reblog: - typeLabel.attributedText = "notifications.reblogged-your-status".localizedBolding( + typeLabel.attributedText = "notifications.reblogged-your-status-%@".localizedBolding( displayName: viewModel.accountViewModel.displayName, emojis: viewModel.accountViewModel.emojis, label: typeLabel, identityContext: viewModel.identityContext) iconImageView.tintColor = .systemGreen case .favourite: - typeLabel.attributedText = "notifications.favourited-your-status".localizedBolding( + typeLabel.attributedText = "notifications.favourited-your-status-%@".localizedBolding( displayName: viewModel.accountViewModel.displayName, emojis: viewModel.accountViewModel.emojis, label: typeLabel, @@ -198,7 +198,7 @@ private extension NotificationView { comment: "") iconImageView.tintColor = nil default: - typeLabel.attributedText = "notifications.unknown".localizedBolding( + typeLabel.attributedText = "notifications.unknown-%@".localizedBolding( displayName: viewModel.accountViewModel.displayName, emojis: viewModel.accountViewModel.emojis, label: typeLabel, diff --git a/Views/UIKit/Content Views/StatusView.swift b/Views/UIKit/Content Views/StatusView.swift index 19b1c32..7f764d4 100644 --- a/Views/UIKit/Content Views/StatusView.swift +++ b/Views/UIKit/Content Views/StatusView.swift @@ -482,7 +482,7 @@ private extension StatusView { hasReplyFollowingView.isHidden = !viewModel.configuration.hasReplyFollowing if viewModel.isReblog { - let attributedTitle = "status.reblogged-by".localizedBolding( + let attributedTitle = "status.reblogged-by-%@".localizedBolding( displayName: viewModel.rebloggedByDisplayName, emojis: viewModel.rebloggedByDisplayNameEmojis, label: infoLabel, @@ -576,11 +576,11 @@ private extension StatusView { let noInteractions = !isContextParent || (noReblogs && noFavorites) rebloggedByButton.setAttributedLocalizedTitle( - localizationKey: "status.reblogs-count", + localizationKey: "status.reblogs-count-%ld", count: viewModel.reblogsCount) rebloggedByButton.isHidden = noReblogs favoritedByButton.setAttributedLocalizedTitle( - localizationKey: "status.favorites-count", + localizationKey: "status.favorites-count-%ld", count: viewModel.favoritesCount) favoritedByButton.isHidden = noFavorites @@ -793,7 +793,7 @@ private extension StatusView { if statusConfiguration.viewModel.repliesCount > 0 { accessibilityAttributedLabel.appendWithSeparator( String.localizedStringWithFormat( - NSLocalizedString("status.replies-count", comment: ""), + NSLocalizedString("status.replies-count-%ld", comment: ""), statusConfiguration.viewModel.repliesCount)) } @@ -801,14 +801,14 @@ private extension StatusView { if statusConfiguration.viewModel.reblogsCount > 0 { accessibilityAttributedLabel.appendWithSeparator( String.localizedStringWithFormat( - NSLocalizedString("status.reblogs-count", comment: ""), + NSLocalizedString("status.reblogs-count-%ld", comment: ""), statusConfiguration.viewModel.reblogsCount)) } if statusConfiguration.viewModel.favoritesCount > 0 { accessibilityAttributedLabel.appendWithSeparator( String.localizedStringWithFormat( - NSLocalizedString("status.favorites-count", comment: ""), + NSLocalizedString("status.favorites-count-%ld", comment: ""), statusConfiguration.viewModel.favoritesCount)) } } diff --git a/Views/UIKit/Content Views/TagView.swift b/Views/UIKit/Content Views/TagView.swift index 24f1b96..1f2e9d4 100644 --- a/Views/UIKit/Content Views/TagView.swift +++ b/Views/UIKit/Content Views/TagView.swift @@ -95,7 +95,7 @@ private extension TagView { if let accounts = viewModel.accounts { let accountsText = String.localizedStringWithFormat( - NSLocalizedString("tag.people-talking", comment: ""), + NSLocalizedString("tag.people-talking-%ld", comment: ""), accounts) accountsLabel.text = accountsText accessibilityLabel.appendWithSeparator(accountsText) diff --git a/Views/UIKit/PollView.swift b/Views/UIKit/PollView.swift index 058cfff..547aa97 100644 --- a/Views/UIKit/PollView.swift +++ b/Views/UIKit/PollView.swift @@ -122,7 +122,7 @@ final class PollView: UIView { stackView.addArrangedSubview(bottomStackView) let votesCount = String.localizedStringWithFormat( - NSLocalizedString("status.poll.participation-count", comment: ""), + NSLocalizedString("status.poll.participation-count-%ld", comment: ""), viewModel.pollVotersCount) votesCountLabel.text = votesCount @@ -132,7 +132,7 @@ final class PollView: UIView { if !viewModel.isPollExpired, let pollTimeLeft = viewModel.pollTimeLeft { expiryLabel.text = String.localizedStringWithFormat( - NSLocalizedString("status.poll.time-left", comment: ""), + NSLocalizedString("status.poll.time-left-%@", comment: ""), pollTimeLeft) refreshButton.isHidden = false accessibilityCustomActions =