set up translations for link labels

This commit is contained in:
Jed Fox 2022-11-07 18:21:19 -05:00
parent 1ce756a849
commit aa87340345
No known key found for this signature in database
GPG Key ID: 0B61D18EA54B47E1
2 changed files with 14 additions and 2 deletions

View File

@ -685,5 +685,13 @@
"multiple_account_switch_intro_description": "Switch between multiple accounts by holding the profile button.",
"accessibility_hint": "Double tap to dismiss this wizard"
}
},
"a11y": {
"meta_entity": {
"url": "Link: %s",
"hashtag": "Hastag %s",
"mention": "Show Profile: %s",
"email": "Email address: %s",
}
}
}
}

View File

@ -11,12 +11,16 @@ extension Meta.Entity {
var accessibilityCustomActionLabel: String? {
switch meta {
case .url(_, trimmed: _, url: let url, userInfo: _):
// TODO: i18n (a11y.meta_entity.url)
return "Link: \(url)"
case .hashtag(_, hashtag: let hashtag, userInfo: _):
// TODO: i18n (a11y.meta_entity.hashtag)
return "Hashtag \(hashtag)"
case .mention(_, mention: let mention, userInfo: _):
return "Show Profile: @\(mention)"
// TODO: i18n (a11y.meta_entity.mention)
return "Show Profile: \("@" + mention)"
case .email(let email, userInfo: _):
// TODO: i18n (a11y.meta_entity.email)
return "Email address: \(email)"
// emoji are not actionable
case .emoji: