mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Add "Translate" to TimelineItemMenuActions (#4846)
* Add "Translate" to TimelineItemMenuActions * Update TimelineView.swift Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com> * Update strings using `download-strings` * Update ElementX/Sources/Screens/Timeline/View/ItemMenu/TimelineItemMenuAction.swift Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com> * Clear `textToBeTranslated` after translation was dismissed * `swift run tools download-strings --all-languages` --------- Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com> # Conflicts: # ElementX/Resources/Localizations/et.lproj/Localizable.strings # ElementX/Resources/Localizations/fr.lproj/Localizable.strings # ElementX/Resources/Localizations/hr.lproj/Localizable.strings
This commit is contained in:
@@ -26,6 +26,7 @@ enum TimelineInteractionHandlerAction {
|
||||
|
||||
case viewInRoomTimeline(eventID: String)
|
||||
case displayThread(itemID: TimelineItemIdentifier)
|
||||
case showTranslation(text: String)
|
||||
}
|
||||
|
||||
/// The interaction handler groups logic for dealing with various actions the user can take on a timeline's
|
||||
@@ -198,6 +199,9 @@ class TimelineInteractionHandler {
|
||||
break // Handled inline in the media preview screen with a ShareLink.
|
||||
case .save:
|
||||
break // Handled inline in the media preview screen.
|
||||
case .translate:
|
||||
guard let messageTimelineItem = timelineItem as? EventBasedMessageTimelineItemProtocol else { return }
|
||||
actionsSubject.send(.showTranslation(text: messageTimelineItem.body))
|
||||
}
|
||||
|
||||
if action.switchToDefaultComposer {
|
||||
|
||||
Reference in New Issue
Block a user