1
0
mirror of https://github.com/mastodon/mastodon-ios.git synced 2024-12-13 17:17:35 +01:00
mastodon-app-ufficiale-ipho.../MastodonSDK/Sources/MastodonUI/Extension/MetaEntity+Accessibility.swift
2022-11-08 13:30:17 -05:00

28 lines
839 B
Swift

//
// MetaEntity+Accessibility.swift
//
//
// Created by Jed Fox on 2022-11-03.
//
import Meta
import MastodonLocalization
extension Meta.Entity {
var accessibilityCustomActionLabel: String? {
switch meta {
case .url(_, trimmed: _, url: let url, userInfo: _):
return L10n.Common.Controls.Status.MetaEntity.url(url)
case .hashtag(_, hashtag: let hashtag, userInfo: _):
return L10n.Common.Controls.Status.MetaEntity.hashtag(hashtag)
case .mention(_, mention: let mention, userInfo: _):
return L10n.Common.Controls.Status.MetaEntity.mention(mention)
case .email(let email, userInfo: _):
return L10n.Common.Controls.Status.MetaEntity.email(email)
// emoji are not actionable
case .emoji:
return nil
}
}
}