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:
@@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Translation
|
||||
import WysiwygComposer
|
||||
|
||||
struct TimelineView: View {
|
||||
@@ -55,6 +56,13 @@ struct TimelineView: View {
|
||||
ReadReceiptsSummaryView(orderedReadReceipts: $0.orderedReceipts)
|
||||
.environmentObject(timelineContext)
|
||||
}
|
||||
.translationPresentation(isPresented: $timelineContext.showTranslation, text: timelineContext.textToBeTranslated ?? "")
|
||||
.onChange(of: timelineContext.showTranslation) { oldValue, newValue in
|
||||
if oldValue, !newValue {
|
||||
// clear texts after translation was dismissed
|
||||
timelineContext.textToBeTranslated = nil
|
||||
}
|
||||
}
|
||||
.onDrop(of: ["public.item", "public.file-url"], isTargeted: $dragOver) { providers -> Bool in
|
||||
let supportedProviders = providers.filter(\.isSupportedForPasteOrDrop)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user