From bb62010b71c2f8cb03de6bfa70eff20a20044098 Mon Sep 17 00:00:00 2001 From: Marissa Le Coz <129999395+marissa-signal@users.noreply.github.com> Date: Fri, 8 Dec 2023 19:45:51 -0500 Subject: [PATCH] Add sticker description to Voiceover --- .../CV/CVComponents/CVComponentSticker.swift | 16 +++++++++++++--- Signal/translations/en.lproj/Localizable.strings | 3 +++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/CV/CVComponents/CVComponentSticker.swift b/Signal/src/ViewControllers/ConversationView/CV/CVComponents/CVComponentSticker.swift index 8f75270175..594547e7c7 100644 --- a/Signal/src/ViewControllers/ConversationView/CV/CVComponents/CVComponentSticker.swift +++ b/Signal/src/ViewControllers/ConversationView/CV/CVComponents/CVComponentSticker.swift @@ -197,8 +197,18 @@ public class CVComponentSticker: CVComponentBase, CVComponent { extension CVComponentSticker: CVAccessibilityComponent { public var accessibilityDescription: String { - // NOTE: We could include the strings used for sticker suggestion. - OWSLocalizedString("ACCESSIBILITY_LABEL_STICKER", - comment: "Accessibility label for stickers.") + if let approximateEmoji = stickerMetadata?.firstEmoji { + return String( + format: OWSLocalizedString( + "ACCESSIBILITY_LABEL_STICKER_FORMAT", + comment: "Accessibility label for stickers. Embeds {{ name of top emoji the sticker resembles }}"), + approximateEmoji + ) + } else { + return OWSLocalizedString( + "ACCESSIBILITY_LABEL_STICKER", + comment: "Accessibility label for stickers." + ) + } } } diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index bb8f4b4032..416aac3b5d 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -25,6 +25,9 @@ /* Accessibility label for stickers. */ "ACCESSIBILITY_LABEL_STICKER" = "Sticker"; +/* Accessibility label for stickers. Embeds {{ name of top emoji the sticker resembles }} */ +"ACCESSIBILITY_LABEL_STICKER_FORMAT" = "Sticker similar to %@"; + /* Accessibility label for a voice memo. */ "ACCESSIBILITY_LABEL_VOICE_MEMO" = "Voice message";