Add sticker description to Voiceover

This commit is contained in:
Marissa Le Coz 2023-12-08 19:45:51 -05:00 committed by GitHub
parent 51940a60e8
commit bb62010b71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 3 deletions

View File

@ -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."
)
}
}
}

View File

@ -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";