From c1dab782b1edf54a0225cfc8fb1fc0bafe932eb7 Mon Sep 17 00:00:00 2001 From: Marcus Kida Date: Wed, 15 Mar 2023 14:58:25 +0100 Subject: [PATCH] =?UTF-8?q?IOS-69:=20Label=20this=20=E2=80=9Cre-blog?= =?UTF-8?q?=E2=80=9D=20otherwise=20it=20sounds=20like=20=E2=80=9Creh-blog?= =?UTF-8?q?=E2=80=9D=20(#975)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Localization/Localizable.stringsdict | 22 +++++++++++++++++++ Localization/app.json | 6 ++++- .../Generated/Strings.swift | 10 +++++++++ .../Resources/Base.lproj/Localizable.strings | 2 ++ .../Base.lproj/Localizable.stringsdict | 22 +++++++++++++++++++ .../en.lproj/Localizable.stringsdict | 22 +++++++++++++++++++ .../View/Control/ActionToolbarContainer.swift | 6 ++--- 7 files changed, 86 insertions(+), 4 deletions(-) diff --git a/Localization/Localizable.stringsdict b/Localization/Localizable.stringsdict index 37ce1f032..a56e4b1e6 100644 --- a/Localization/Localizable.stringsdict +++ b/Localization/Localizable.stringsdict @@ -231,6 +231,28 @@ %ld reblogs + plural.count.reblog_a11y + + NSStringLocalizedFormatKey + %#@reblog_count@ + reblog_count + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + ld + zero + 0 re-blogs + one + 1 re-blog + few + %ld re-blogs + many + %ld re-blogs + other + %ld re-blogs + + plural.count.reply NSStringLocalizedFormatKey diff --git a/Localization/app.json b/Localization/app.json index 07a158b2a..3d2f13925 100644 --- a/Localization/app.json +++ b/Localization/app.json @@ -171,7 +171,11 @@ "show_gif": "Show GIF", "show_video_player": "Show video player", "share_link_in_post": "Share Link in Post", - "tap_then_hold_to_show_menu": "Tap then hold to show menu" + "tap_then_hold_to_show_menu": "Tap then hold to show menu", + "a11y_labels": { + "reblog": "Re-blog", + "unreblog": "Undo re-blog" + } }, "tag": { "url": "URL", diff --git a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift index ae8b631b9..a08b3c76c 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift +++ b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift @@ -349,6 +349,12 @@ public enum L10n { public static let unfavorite = L10n.tr("Localizable", "Common.Controls.Status.Actions.Unfavorite", fallback: "Unfavorite") /// Undo reblog public static let unreblog = L10n.tr("Localizable", "Common.Controls.Status.Actions.Unreblog", fallback: "Undo reblog") + public enum A11yLabels { + /// Re-blog + public static let reblog = L10n.tr("Localizable", "Common.Controls.Status.Actions.A11yLabels.Reblog", fallback: "Re-blog") + /// Undo re-blog + public static let unreblog = L10n.tr("Localizable", "Common.Controls.Status.Actions.A11yLabels.Unreblog", fallback: "Undo re-blog") + } } public enum Buttons { /// Last edit %@ @@ -1703,6 +1709,10 @@ public enum L10n { public static func reblog(_ p1: Int) -> String { return L10n.tr("Localizable", "plural.count.reblog", p1, fallback: "Plural format key: \"%#@reblog_count@\"") } + /// Plural format key: "%#@reblog_count@" + public static func reblogA11y(_ p1: Int) -> String { + return L10n.tr("Localizable", "plural.count.reblog_a11y", p1, fallback: "Plural format key: \"%#@reblog_count@\"") + } /// Plural format key: "%#@reply_count@" public static func reply(_ p1: Int) -> String { return L10n.tr("Localizable", "plural.count.reply", p1, fallback: "Plural format key: \"%#@reply_count@\"") diff --git a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings index 8dc1893f2..fabd07875 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings +++ b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings @@ -114,6 +114,8 @@ Please check your internet connection."; "Common.Controls.Status.Actions.TapThenHoldToShowMenu" = "Tap then hold to show menu"; "Common.Controls.Status.Actions.Unfavorite" = "Unfavorite"; "Common.Controls.Status.Actions.Unreblog" = "Undo reblog"; +"Common.Controls.Status.Actions.A11yLabels.Reblog" = "Re-blog"; +"Common.Controls.Status.Actions.A11yLabels.Unreblog" = "Undo re-blog"; "Common.Controls.Status.ContentWarning" = "Content Warning"; "Common.Controls.Status.LinkViaUser" = "%@ via %@"; "Common.Controls.Status.LoadEmbed" = "Load Embed"; diff --git a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.stringsdict b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.stringsdict index 37ce1f032..4b8730a82 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.stringsdict +++ b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.stringsdict @@ -231,6 +231,28 @@ %ld reblogs + plural.count.reblog_a11y + + NSStringLocalizedFormatKey + %#@reblog_count@ + reblog_count + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + ld + zero + 0 re-blogs + one + 1 re-blog + few + %ld re-blogs + many + %ld re-blogs + other + %ld re-blogs + + plural.count.reply NSStringLocalizedFormatKey diff --git a/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.stringsdict b/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.stringsdict index 788eb95fc..5b62b7350 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.stringsdict +++ b/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.stringsdict @@ -173,6 +173,28 @@ %ld reblogs + plural.count.reblog_a11y + + NSStringLocalizedFormatKey + %#@reblog_count@ + reblog_count + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + ld + zero + 0 re-blogs + one + 1 re-blog + few + %ld re-blogs + many + %ld re-blogs + other + %ld re-blogs + + plural.count.reply NSStringLocalizedFormatKey diff --git a/MastodonSDK/Sources/MastodonUI/View/Control/ActionToolbarContainer.swift b/MastodonSDK/Sources/MastodonUI/View/Control/ActionToolbarContainer.swift index ccb59157a..cf4bdaee7 100644 --- a/MastodonSDK/Sources/MastodonUI/View/Control/ActionToolbarContainer.swift +++ b/MastodonSDK/Sources/MastodonUI/View/Control/ActionToolbarContainer.swift @@ -227,7 +227,7 @@ extension ActionToolbarContainer { public func configureReblog(count: Int, isEnabled: Bool, isHighlighted: Bool) { let title = ActionToolbarContainer.title(from: count) reblogButton.setTitle(title, for: .normal) - reblogButton.accessibilityValue = L10n.Plural.Count.reblog(count) + reblogButton.accessibilityValue = L10n.Plural.Count.reblogA11y(count) reblogButton.isEnabled = isEnabled reblogButton.setImage(ActionToolbarContainer.reblogImage, for: .normal) let tintColor = isHighlighted ? Asset.Colors.successGreen.color : Asset.Colors.Button.actionToolbar.color @@ -237,10 +237,10 @@ extension ActionToolbarContainer { if isHighlighted { reblogButton.accessibilityTraits.insert(.selected) - reblogButton.accessibilityLabel = L10n.Common.Controls.Status.Actions.unreblog + reblogButton.accessibilityLabel = L10n.Common.Controls.Status.Actions.A11yLabels.unreblog } else { reblogButton.accessibilityTraits.remove(.selected) - reblogButton.accessibilityLabel = L10n.Common.Controls.Status.Actions.reblog + reblogButton.accessibilityLabel = L10n.Common.Controls.Status.Actions.A11yLabels.reblog } reblogButton.accessibilityCustomActions = [ UIAccessibilityCustomAction(name: "Show All Reblogs") { [weak self] action in