Add a “Show Original” accessibility action to statuses when relevant
This commit is contained in:
parent
ab7166017b
commit
97f5132977
|
@ -628,10 +628,19 @@ extension StatusView {
|
||||||
get {
|
get {
|
||||||
(contentMetaText.textView.accessibilityCustomActions ?? [])
|
(contentMetaText.textView.accessibilityCustomActions ?? [])
|
||||||
+ toolbarActions
|
+ toolbarActions
|
||||||
|
+ (hideTranslationAction.map { [$0] } ?? [])
|
||||||
+ (authorView.accessibilityCustomActions ?? [])
|
+ (authorView.accessibilityCustomActions ?? [])
|
||||||
}
|
}
|
||||||
set { }
|
set { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var hideTranslationAction: UIAccessibilityCustomAction? {
|
||||||
|
guard viewModel.translatedFromLanguage != nil else { return nil }
|
||||||
|
return UIAccessibilityCustomAction(name: L10n.Common.Controls.Status.Translation.showOriginal) { [weak self] _ in
|
||||||
|
self?.revertTranslation()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - AdaptiveContainerView
|
// MARK: - AdaptiveContainerView
|
||||||
|
|
Loading…
Reference in New Issue