mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +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:
@@ -57,6 +57,7 @@ struct TimelineItemMenuReaction: Hashable {
|
||||
|
||||
enum TimelineItemMenuAction: Identifiable, Hashable {
|
||||
case copy
|
||||
case translate
|
||||
case copyCaption
|
||||
case edit
|
||||
case addCaption
|
||||
@@ -145,6 +146,13 @@ enum TimelineItemMenuAction: Identifiable, Hashable {
|
||||
switch self {
|
||||
case .copy:
|
||||
Label(L10n.actionCopyText, icon: \.copy)
|
||||
case .translate:
|
||||
Label { Text(L10n.actionTranslate) } icon: {
|
||||
Image(systemSymbol: .translate)
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.scaledFrame(size: 24)
|
||||
}
|
||||
case .copyCaption:
|
||||
Label(L10n.actionCopyCaption, icon: \.copy)
|
||||
case .edit:
|
||||
|
||||
@@ -91,6 +91,7 @@ struct TimelineItemMenuActionProvider {
|
||||
|
||||
if item.isCopyable {
|
||||
actions.append(.copy)
|
||||
actions.append(.translate)
|
||||
} else if item.hasMediaCaption {
|
||||
actions.append(.copyCaption)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user