mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
Update localization
This commit is contained in:
@@ -10152,3 +10152,48 @@ Sorry for the inconvenience.";
|
|||||||
"Chat.ErrorQuoteOutdatedActionEdit" = "Edit";
|
"Chat.ErrorQuoteOutdatedActionEdit" = "Edit";
|
||||||
|
|
||||||
"Premium.BoostByGiftDescription" = "Boost your channel by gifting your subscribers Telegram Premium. [Get boosts >]()";
|
"Premium.BoostByGiftDescription" = "Boost your channel by gifting your subscribers Telegram Premium. [Get boosts >]()";
|
||||||
|
|
||||||
|
"ChatContextMenu.QuoteSelectionTip" = "Hold on a word, then move cursor to select more| text to quote.";
|
||||||
|
|
||||||
|
"Chat.ReplyPanel.ReplyToQuoteBy" = "Reply to Quote by %@";
|
||||||
|
"Chat.ReplyPanel.ReplyTo" = "Reply to %@";
|
||||||
|
"Chat.ReplyPanel.AccessibilityReplyToMessageFrom" = "Reply to message. From: %@";
|
||||||
|
"Chat.ReplyPanel.AccessibilityReplyToYourMessage" = "Reply to your message.";
|
||||||
|
"Chat.ReplyPanel.AccessibilityReplyToMessage" = "Reply to message.";
|
||||||
|
"Chat.ReplyPanel.HintReplyOptions" = "Tap here for reply options";
|
||||||
|
"Chat.ReplyPanel.HintReplyOptionsShort" = "Tap here for options";
|
||||||
|
|
||||||
|
"Chat.ToastQuoteChatUnavailbalePrivateChannel" = "This quote is from a private channel";
|
||||||
|
"Chat.ToastQuoteChatUnavailbalePrivateGroup" = "This quote is from a private group";
|
||||||
|
"Chat.ToastQuoteChatUnavailbalePrivateChat" = "This quote is from a private chat";
|
||||||
|
|
||||||
|
"Chat.TitleQuoteSelection" = "Reply to Quote";
|
||||||
|
"Chat.TitleReply" = "Reply to Message";
|
||||||
|
"Chat.TitleLinkOptions" = "Link Preview Settings";
|
||||||
|
"Chat.SubtitleQuoteSelectionTip" = "You can select a specific part to quote";
|
||||||
|
"Chat.SubtitleLinkListTip" = "Tap on a link to generate its preview";
|
||||||
|
|
||||||
|
"Chat.ToastQuoteNotFound" = "Quote not found";
|
||||||
|
|
||||||
|
"TextFormat.Quote" = "Quote";
|
||||||
|
|
||||||
|
"TextSelection.SelectAll" = "Select All";
|
||||||
|
|
||||||
|
"Conversation.MessageOptionsApplyChanges" = "Apply Changes";
|
||||||
|
"Conversation.ForwardOptionsCancel" = "Do Not Forward";
|
||||||
|
"Conversation.MessageOptionsTabForward" = "Forward";
|
||||||
|
"Conversation.MessageOptionsQuoteSelectedPart" = "Quote Selected Part";
|
||||||
|
"Conversation.MessageOptionsQuoteSelect" = "Select Specific Quote";
|
||||||
|
"Conversation.MessageOptionsQuoteRemove" = "Remove Quote";
|
||||||
|
"Conversation.MessageOptionsReplyInAnotherChat" = "Reply in Another Chat";
|
||||||
|
"Conversation.MessageOptionsReplyCancel" = "Do Not Reply";
|
||||||
|
"Conversation.MessageOptionsTabReply" = "Reply";
|
||||||
|
"Conversation.MoveReplyToAnotherChatTitle" = "Reply in...";
|
||||||
|
"Conversation.MessageOptionsLinkMoveUp" = "Move Up";
|
||||||
|
"Conversation.MessageOptionsLinkMoveDown" = "Move Down";
|
||||||
|
"Conversation.MessageOptionsShrinkImage" = "Shrink Photo";
|
||||||
|
"Conversation.MessageOptionsEnlargeImage" = "Enlarge Photo";
|
||||||
|
"Conversation.MessageOptionsShrinkVideo" = "Shrink Video";
|
||||||
|
"Conversation.MessageOptionsEnlargeVideo" = "Enlarge Video";
|
||||||
|
"Conversation.LinkOptionsCancel" = "Do Not Preview";
|
||||||
|
"Conversation.MessageOptionsTabLink" = "Link";
|
||||||
|
|||||||
@@ -404,8 +404,7 @@ final class InnerTextSelectionTipContainerNode: ASDisplayNode {
|
|||||||
}
|
}
|
||||||
icon = UIImage(bundleImageName: "Chat/Context Menu/Tip")
|
icon = UIImage(bundleImageName: "Chat/Context Menu/Tip")
|
||||||
case .quoteSelection:
|
case .quoteSelection:
|
||||||
//TODO:localize
|
var rawText = presentationData.strings.ChatContextMenu_QuoteSelectionTip
|
||||||
var rawText = "Hold on a word, then move cursor to select more| text to quote."
|
|
||||||
if let range = rawText.range(of: "|") {
|
if let range = rawText.range(of: "|") {
|
||||||
rawText.removeSubrange(range)
|
rawText.removeSubrange(range)
|
||||||
self.text = rawText
|
self.text = rawText
|
||||||
|
|||||||
@@ -318,8 +318,7 @@ public class ChatMessageReplyInfoNode: ASDisplayNode {
|
|||||||
titleString = NSAttributedString(string: rawTitleString, font: titleFont, textColor: titleColor)
|
titleString = NSAttributedString(string: rawTitleString, font: titleFont, textColor: titleColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO:localize
|
textString = NSAttributedString(string: replyForward.quote?.text ?? arguments.presentationData.strings.VoiceOver_ChatList_Message)
|
||||||
textString = NSAttributedString(string: replyForward.quote?.text ?? "Message")
|
|
||||||
if let media = replyForward.quote?.media {
|
if let media = replyForward.quote?.media {
|
||||||
if let text = replyForward.quote?.text, !text.isEmpty {
|
if let text = replyForward.quote?.text, !text.isEmpty {
|
||||||
} else {
|
} else {
|
||||||
@@ -327,7 +326,7 @@ public class ChatMessageReplyInfoNode: ASDisplayNode {
|
|||||||
let (string, _) = stringForMediaKind(contentKind, strings: arguments.strings)
|
let (string, _) = stringForMediaKind(contentKind, strings: arguments.strings)
|
||||||
textString = string
|
textString = string
|
||||||
} else {
|
} else {
|
||||||
textString = NSAttributedString(string: "Message")
|
textString = NSAttributedString(string: arguments.presentationData.strings.VoiceOver_ChatList_Message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
isMedia = true
|
isMedia = true
|
||||||
|
|||||||
@@ -242,26 +242,33 @@ public final class ReplyAccessoryPanelNode: AccessoryPanelNode {
|
|||||||
let icon: UIImage?
|
let icon: UIImage?
|
||||||
icon = UIImage(bundleImageName: "Chat/Input/Accessory Panels/PanelTextChannelIcon")?.withRenderingMode(.alwaysTemplate)
|
icon = UIImage(bundleImageName: "Chat/Input/Accessory Panels/PanelTextChannelIcon")?.withRenderingMode(.alwaysTemplate)
|
||||||
|
|
||||||
//TODO:localize
|
if let icon {
|
||||||
if let _ = strongSelf.quote {
|
let rawString: PresentationStrings.FormattedString
|
||||||
if let icon {
|
if strongSelf.quote != nil {
|
||||||
let string = "Reply to Quote by "
|
rawString = strongSelf.strings.Chat_ReplyPanel_ReplyToQuoteBy(peer.debugDisplayTitle)
|
||||||
titleText = [.text(NSAttributedString(string: string, font: Font.medium(15.0), textColor: strongSelf.theme.chat.inputPanel.panelControlAccentColor))]
|
} else {
|
||||||
titleText.append(.icon(icon))
|
rawString = strongSelf.strings.Chat_ReplyPanel_ReplyTo(peer.debugDisplayTitle)
|
||||||
titleText.append(.text(NSAttributedString(string: peer.debugDisplayTitle, font: Font.medium(15.0), textColor: strongSelf.theme.chat.inputPanel.panelControlAccentColor)))
|
|
||||||
}
|
}
|
||||||
} else {
|
if let nameRange = rawString.ranges.first {
|
||||||
if let icon {
|
titleText = []
|
||||||
let string = "Reply to "
|
|
||||||
titleText = [.text(NSAttributedString(string: string, font: Font.medium(15.0), textColor: strongSelf.theme.chat.inputPanel.panelControlAccentColor))]
|
let rawNsString = rawString.string as NSString
|
||||||
|
if nameRange.range.lowerBound != 0 {
|
||||||
|
titleText.append(.text(NSAttributedString(string: rawNsString.substring(with: NSRange(location: 0, length: nameRange.range.lowerBound)), font: Font.medium(15.0), textColor: strongSelf.theme.chat.inputPanel.panelControlAccentColor)))
|
||||||
|
}
|
||||||
titleText.append(.icon(icon))
|
titleText.append(.icon(icon))
|
||||||
titleText.append(.text(NSAttributedString(string: peer.debugDisplayTitle, font: Font.medium(15.0), textColor: strongSelf.theme.chat.inputPanel.panelControlAccentColor)))
|
titleText.append(.text(NSAttributedString(string: peer.debugDisplayTitle, font: Font.medium(15.0), textColor: strongSelf.theme.chat.inputPanel.panelControlAccentColor)))
|
||||||
|
|
||||||
|
if nameRange.range.upperBound != rawNsString.length {
|
||||||
|
titleText.append(.text(NSAttributedString(string: rawNsString.substring(with: NSRange(location: nameRange.range.upperBound, length: rawNsString.length - nameRange.range.upperBound)), font: Font.medium(15.0), textColor: strongSelf.theme.chat.inputPanel.panelControlAccentColor)))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
titleText.append(.text(NSAttributedString(string: rawString.string, font: Font.medium(15.0), textColor: strongSelf.theme.chat.inputPanel.panelControlAccentColor)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if let _ = strongSelf.quote {
|
if let _ = strongSelf.quote {
|
||||||
//TODO:localize
|
let string = strongSelf.strings.Chat_ReplyPanel_ReplyToQuoteBy(authorName).string
|
||||||
let string = "Reply to Quote by \(authorName)"
|
|
||||||
titleText = [.text(NSAttributedString(string: string, font: Font.medium(15.0), textColor: strongSelf.theme.chat.inputPanel.panelControlAccentColor))]
|
titleText = [.text(NSAttributedString(string: string, font: Font.medium(15.0), textColor: strongSelf.theme.chat.inputPanel.panelControlAccentColor))]
|
||||||
} else {
|
} else {
|
||||||
let string = strongSelf.strings.Conversation_ReplyMessagePanelTitle(authorName).string
|
let string = strongSelf.strings.Conversation_ReplyMessagePanelTitle(authorName).string
|
||||||
@@ -297,11 +304,11 @@ public final class ReplyAccessoryPanelNode: AccessoryPanelNode {
|
|||||||
|
|
||||||
let headerString: String
|
let headerString: String
|
||||||
if let message = message, message.flags.contains(.Incoming), let author = message.author {
|
if let message = message, message.flags.contains(.Incoming), let author = message.author {
|
||||||
headerString = "Reply to message. From: \(EnginePeer(author).displayTitle(strings: strings, displayOrder: nameDisplayOrder))"
|
headerString = strongSelf.strings.Chat_ReplyPanel_AccessibilityReplyToMessageFrom(EnginePeer(author).displayTitle(strings: strings, displayOrder: nameDisplayOrder)).string
|
||||||
} else if let message = message, !message.flags.contains(.Incoming) {
|
} else if let message = message, !message.flags.contains(.Incoming) {
|
||||||
headerString = "Reply to your message"
|
headerString = strongSelf.strings.Chat_ReplyPanel_AccessibilityReplyToYourMessage
|
||||||
} else {
|
} else {
|
||||||
headerString = "Reply to message"
|
headerString = strongSelf.strings.Chat_ReplyPanel_AccessibilityReplyToMessage
|
||||||
}
|
}
|
||||||
strongSelf.actionArea.accessibilityLabel = "\(headerString).\n\(text)"
|
strongSelf.actionArea.accessibilityLabel = "\(headerString).\n\(text)"
|
||||||
|
|
||||||
@@ -326,11 +333,10 @@ public final class ReplyAccessoryPanelNode: AccessoryPanelNode {
|
|||||||
Queue.mainQueue().after(3.0) {
|
Queue.mainQueue().after(3.0) {
|
||||||
if let snapshotView = strongSelf.textNode.view.snapshotContentTree() {
|
if let snapshotView = strongSelf.textNode.view.snapshotContentTree() {
|
||||||
let text: String
|
let text: String
|
||||||
//TODO:localize
|
|
||||||
if let (size, _, _) = strongSelf.validLayout, size.width > 320.0 {
|
if let (size, _, _) = strongSelf.validLayout, size.width > 320.0 {
|
||||||
text = "Tap here for reply options"
|
text = strongSelf.strings.Chat_ReplyPanel_HintReplyOptions
|
||||||
} else {
|
} else {
|
||||||
text = "Tap here for forwarding options"
|
text = strongSelf.strings.Chat_ReplyPanel_HintReplyOptionsShort
|
||||||
}
|
}
|
||||||
strongSelf.textIsOptions = true
|
strongSelf.textIsOptions = true
|
||||||
|
|
||||||
|
|||||||
@@ -2708,8 +2708,6 @@ public final class StoryItemSetContainerComponent: Component {
|
|||||||
|
|
||||||
let inputPlaceholder: MessageInputPanelComponent.Placeholder
|
let inputPlaceholder: MessageInputPanelComponent.Placeholder
|
||||||
if let stealthModeTimeout = component.stealthModeTimeout {
|
if let stealthModeTimeout = component.stealthModeTimeout {
|
||||||
//TODO:localize
|
|
||||||
|
|
||||||
let minutes = Int(stealthModeTimeout / 60)
|
let minutes = Int(stealthModeTimeout / 60)
|
||||||
let seconds = Int(stealthModeTimeout % 60)
|
let seconds = Int(stealthModeTimeout % 60)
|
||||||
|
|
||||||
|
|||||||
@@ -229,28 +229,11 @@ private func chatForwardOptions(selfController: ChatControllerImpl, sourceNode:
|
|||||||
f(.default)
|
f(.default)
|
||||||
})))
|
})))
|
||||||
|
|
||||||
//TODO:localize
|
items.append(.action(ContextMenuActionItem(text: presentationData.strings.Conversation_MessageOptionsApplyChanges, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Select"), color: theme.contextMenu.primaryColor) }, action: { _, f in
|
||||||
items.append(.action(ContextMenuActionItem(text: "Apply Changes", icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Select"), color: theme.contextMenu.primaryColor) }, action: { _, f in
|
|
||||||
f(.default)
|
f(.default)
|
||||||
})))
|
})))
|
||||||
|
|
||||||
/*items.append(.action(ContextMenuActionItem(text: messagesCount == 1 ? presentationData.strings.Conversation_ForwardOptions_SendMessage : presentationData.strings.Conversation_ForwardOptions_SendMessages, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Resend"), color: theme.contextMenu.primaryColor) }, action: { [weak selfController, weak chatController] c, f in
|
items.append(.action(ContextMenuActionItem(text: presentationData.strings.Conversation_ForwardOptionsCancel, textColor: .destructive, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Delete"), color: theme.contextMenu.destructiveColor) }, action: { [weak selfController] c, f in
|
||||||
guard let selfController else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if let selectedMessageIds = (chatController as? ChatControllerImpl)?.selectedMessageIds {
|
|
||||||
var forwardMessageIds = selfController.presentationInterfaceState.interfaceState.forwardMessageIds ?? []
|
|
||||||
forwardMessageIds = forwardMessageIds.filter { selectedMessageIds.contains($0) }
|
|
||||||
selfController.updateChatPresentationInterfaceState(interactive: false, { $0.updatedInterfaceState({ $0.withUpdatedForwardMessageIds(forwardMessageIds) }) })
|
|
||||||
}
|
|
||||||
|
|
||||||
selfController.controllerInteraction?.sendCurrentMessage(false)
|
|
||||||
|
|
||||||
f(.default)
|
|
||||||
})))*/
|
|
||||||
|
|
||||||
//TODO:localize
|
|
||||||
items.append(.action(ContextMenuActionItem(text: "Do Not Forward", textColor: .destructive, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Delete"), color: theme.contextMenu.destructiveColor) }, action: { [weak selfController] c, f in
|
|
||||||
f(.default)
|
f(.default)
|
||||||
|
|
||||||
guard let selfController else {
|
guard let selfController else {
|
||||||
@@ -273,10 +256,9 @@ private func chatForwardOptions(selfController: ChatControllerImpl, sourceNode:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO:localize
|
|
||||||
return (ContextController.Source(
|
return (ContextController.Source(
|
||||||
id: AnyHashable(OptionsId.forward),
|
id: AnyHashable(OptionsId.forward),
|
||||||
title: "Forward",
|
title: selfController.presentationData.strings.Conversation_MessageOptionsTabForward,
|
||||||
source: .controller(ChatContextControllerContentSourceImpl(controller: chatController, sourceNode: sourceNode, passthroughTouches: true)),
|
source: .controller(ChatContextControllerContentSourceImpl(controller: chatController, sourceNode: sourceNode, passthroughTouches: true)),
|
||||||
items: items |> map { ContextController.Items(id: AnyHashable("forward"), content: .list($0)) }
|
items: items |> map { ContextController.Items(id: AnyHashable("forward"), content: .list($0)) }
|
||||||
), dismissedForCancel)
|
), dismissedForCancel)
|
||||||
@@ -304,8 +286,7 @@ private func generateChatReplyOptionItems(selfController: ChatControllerImpl, ch
|
|||||||
var items: [ContextMenuItem] = []
|
var items: [ContextMenuItem] = []
|
||||||
|
|
||||||
if replySubject.quote != nil {
|
if replySubject.quote != nil {
|
||||||
//TODO:localize
|
items.append(.action(ContextMenuActionItem(text: selfController.presentationData.strings.Conversation_MessageOptionsQuoteSelectedPart, icon: { theme in
|
||||||
items.append(.action(ContextMenuActionItem(text: "Quote Selected Part", icon: { theme in
|
|
||||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/QuoteSelected"), color: theme.contextMenu.primaryColor)
|
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/QuoteSelected"), color: theme.contextMenu.primaryColor)
|
||||||
}, action: { [weak selfController, weak chatController] _, f in
|
}, action: { [weak selfController, weak chatController] _, f in
|
||||||
guard let selfController, let chatController else {
|
guard let selfController, let chatController else {
|
||||||
@@ -345,8 +326,7 @@ private func generateChatReplyOptionItems(selfController: ChatControllerImpl, ch
|
|||||||
f(.default)
|
f(.default)
|
||||||
})))
|
})))
|
||||||
} else if let message = messages.first, !message.text.isEmpty {
|
} else if let message = messages.first, !message.text.isEmpty {
|
||||||
//TODO:localize
|
items.append(.action(ContextMenuActionItem(text: selfController.presentationData.strings.Conversation_MessageOptionsQuoteSelect, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Quote"), color: theme.contextMenu.primaryColor) }, action: { [weak selfController, weak chatController] c, _ in
|
||||||
items.append(.action(ContextMenuActionItem(text: "Select Specific Quote", icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Quote"), color: theme.contextMenu.primaryColor) }, action: { [weak selfController, weak chatController] c, _ in
|
|
||||||
guard let selfController, let chatController else {
|
guard let selfController, let chatController else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -371,8 +351,7 @@ private func generateChatReplyOptionItems(selfController: ChatControllerImpl, ch
|
|||||||
})))
|
})))
|
||||||
subItems.append(.separator)
|
subItems.append(.separator)
|
||||||
|
|
||||||
//TODO:localize
|
subItems.append(.action(ContextMenuActionItem(text: selfController.presentationData.strings.Conversation_MessageOptionsQuoteSelectedPart, icon: { theme in
|
||||||
subItems.append(.action(ContextMenuActionItem(text: "Quote Selected Part", icon: { theme in
|
|
||||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/QuoteSelected"), color: theme.contextMenu.primaryColor)
|
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/QuoteSelected"), color: theme.contextMenu.primaryColor)
|
||||||
}, action: { [weak selfController, weak contentNode] _, f in
|
}, action: { [weak selfController, weak contentNode] _, f in
|
||||||
guard let selfController, let contentNode else {
|
guard let selfController, let contentNode else {
|
||||||
@@ -438,8 +417,7 @@ private func generateChatReplyOptionItems(selfController: ChatControllerImpl, ch
|
|||||||
}
|
}
|
||||||
|
|
||||||
if canReplyInAnotherChat {
|
if canReplyInAnotherChat {
|
||||||
//TODO:localize
|
items.append(.action(ContextMenuActionItem(text: selfController.presentationData.strings.Conversation_MessageOptionsReplyInAnotherChat, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Replace"), color: theme.contextMenu.primaryColor) }, action: { [weak selfController] c, f in
|
||||||
items.append(.action(ContextMenuActionItem(text: "Reply in Another Chat", icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Replace"), color: theme.contextMenu.primaryColor) }, action: { [weak selfController] c, f in
|
|
||||||
f(.default)
|
f(.default)
|
||||||
|
|
||||||
guard let selfController else {
|
guard let selfController else {
|
||||||
@@ -455,13 +433,13 @@ private func generateChatReplyOptionItems(selfController: ChatControllerImpl, ch
|
|||||||
if !items.isEmpty {
|
if !items.isEmpty {
|
||||||
items.append(.separator)
|
items.append(.separator)
|
||||||
|
|
||||||
items.append(.action(ContextMenuActionItem(text: "Apply Changes", icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Select"), color: theme.contextMenu.primaryColor) }, action: { _, f in
|
items.append(.action(ContextMenuActionItem(text: selfController.presentationData.strings.Conversation_MessageOptionsApplyChanges, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Select"), color: theme.contextMenu.primaryColor) }, action: { _, f in
|
||||||
f(.default)
|
f(.default)
|
||||||
})))
|
})))
|
||||||
}
|
}
|
||||||
|
|
||||||
if replySubject.quote != nil {
|
if replySubject.quote != nil {
|
||||||
items.append(.action(ContextMenuActionItem(text: "Remove Quote", textColor: .destructive, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/QuoteRemove"), color: theme.contextMenu.destructiveColor) }, action: { [weak selfController] c, f in
|
items.append(.action(ContextMenuActionItem(text: selfController.presentationData.strings.Conversation_MessageOptionsQuoteRemove, textColor: .destructive, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/QuoteRemove"), color: theme.contextMenu.destructiveColor) }, action: { [weak selfController] c, f in
|
||||||
f(.default)
|
f(.default)
|
||||||
|
|
||||||
guard let selfController else {
|
guard let selfController else {
|
||||||
@@ -472,7 +450,7 @@ private func generateChatReplyOptionItems(selfController: ChatControllerImpl, ch
|
|||||||
selfController.updateChatPresentationInterfaceState(animated: false, interactive: true, { $0.updatedInterfaceState({ $0.withUpdatedReplyMessageSubject(replySubject).withoutSelectionState() }).updatedSearch(nil) })
|
selfController.updateChatPresentationInterfaceState(animated: false, interactive: true, { $0.updatedInterfaceState({ $0.withUpdatedReplyMessageSubject(replySubject).withoutSelectionState() }).updatedSearch(nil) })
|
||||||
})))
|
})))
|
||||||
} else {
|
} else {
|
||||||
items.append(.action(ContextMenuActionItem(text: "Do Not Reply", textColor: .destructive, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Delete"), color: theme.contextMenu.destructiveColor) }, action: { [weak selfController] c, f in
|
items.append(.action(ContextMenuActionItem(text: selfController.presentationData.strings.Conversation_MessageOptionsReplyCancel, textColor: .destructive, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Delete"), color: theme.contextMenu.destructiveColor) }, action: { [weak selfController] c, f in
|
||||||
f(.default)
|
f(.default)
|
||||||
|
|
||||||
guard let selfController else {
|
guard let selfController else {
|
||||||
@@ -539,10 +517,9 @@ private func chatReplyOptions(selfController: ChatControllerImpl, sourceNode: AS
|
|||||||
selfController.controllerInteraction?.performTextSelectionAction(message, canCopy, text, action)
|
selfController.controllerInteraction?.performTextSelectionAction(message, canCopy, text, action)
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO:localize
|
|
||||||
return ContextController.Source(
|
return ContextController.Source(
|
||||||
id: AnyHashable(OptionsId.reply),
|
id: AnyHashable(OptionsId.reply),
|
||||||
title: "Reply",
|
title: selfController.presentationData.strings.Conversation_MessageOptionsTabReply,
|
||||||
source: .controller(ChatContextControllerContentSourceImpl(controller: chatController, sourceNode: sourceNode, passthroughTouches: true)),
|
source: .controller(ChatContextControllerContentSourceImpl(controller: chatController, sourceNode: sourceNode, passthroughTouches: true)),
|
||||||
items: items
|
items: items
|
||||||
)
|
)
|
||||||
@@ -564,7 +541,7 @@ func moveReplyMessageToAnotherChat(selfController: ChatControllerImpl, replySubj
|
|||||||
updatedPresentationData: selfController.updatedPresentationData,
|
updatedPresentationData: selfController.updatedPresentationData,
|
||||||
filter: filter,
|
filter: filter,
|
||||||
hasFilters: true,
|
hasFilters: true,
|
||||||
title: "Reply in...", //TODO:localize
|
title: selfController.presentationData.strings.Conversation_MoveReplyToAnotherChatTitle,
|
||||||
attemptSelection: { peer, _ in
|
attemptSelection: { peer, _ in
|
||||||
attemptSelectionImpl?(peer)
|
attemptSelectionImpl?(peer)
|
||||||
},
|
},
|
||||||
@@ -759,8 +736,7 @@ private func chatLinkOptions(selfController: ChatControllerImpl, sourceNode: ASD
|
|||||||
var items: [ContextMenuItem] = []
|
var items: [ContextMenuItem] = []
|
||||||
|
|
||||||
do {
|
do {
|
||||||
//TODO:localize
|
items.append(.action(ContextMenuActionItem(text: linkOptions.linkBelowText ? selfController.presentationData.strings.Conversation_MessageOptionsLinkMoveUp : selfController.presentationData.strings.Conversation_MessageOptionsLinkMoveDown, icon: { theme in
|
||||||
items.append(.action(ContextMenuActionItem(text: linkOptions.linkBelowText ? "Move Up" : "Move Down", icon: { theme in
|
|
||||||
return nil
|
return nil
|
||||||
}, iconAnimation: ContextMenuActionItem.IconAnimation(
|
}, iconAnimation: ContextMenuActionItem.IconAnimation(
|
||||||
name: linkOptions.linkBelowText ? "message_preview_sort_above" : "message_preview_sort_below"
|
name: linkOptions.linkBelowText ? "message_preview_sort_above" : "message_preview_sort_below"
|
||||||
@@ -784,15 +760,14 @@ private func chatLinkOptions(selfController: ChatControllerImpl, sourceNode: ASD
|
|||||||
}
|
}
|
||||||
|
|
||||||
if case let .Loaded(content) = linkOptions.webpage.content, let isMediaLargeByDefault = content.isMediaLargeByDefault, isMediaLargeByDefault {
|
if case let .Loaded(content) = linkOptions.webpage.content, let isMediaLargeByDefault = content.isMediaLargeByDefault, isMediaLargeByDefault {
|
||||||
//TODO:localize
|
|
||||||
let shrinkTitle: String
|
let shrinkTitle: String
|
||||||
let enlargeTitle: String
|
let enlargeTitle: String
|
||||||
if let file = content.file, file.isVideo {
|
if let file = content.file, file.isVideo {
|
||||||
shrinkTitle = "Shrink Video"
|
shrinkTitle = selfController.presentationData.strings.Conversation_MessageOptionsShrinkVideo
|
||||||
enlargeTitle = "Enlarge Video"
|
enlargeTitle = selfController.presentationData.strings.Conversation_MessageOptionsEnlargeVideo
|
||||||
} else {
|
} else {
|
||||||
shrinkTitle = "Shrink Photo"
|
shrinkTitle = selfController.presentationData.strings.Conversation_MessageOptionsShrinkImage
|
||||||
enlargeTitle = "Enlarge Photo"
|
enlargeTitle = selfController.presentationData.strings.Conversation_MessageOptionsEnlargeImage
|
||||||
}
|
}
|
||||||
|
|
||||||
items.append(.action(ContextMenuActionItem(text: linkOptions.largeMedia ? shrinkTitle : enlargeTitle, icon: { _ in
|
items.append(.action(ContextMenuActionItem(text: linkOptions.largeMedia ? shrinkTitle : enlargeTitle, icon: { _ in
|
||||||
@@ -830,13 +805,11 @@ private func chatLinkOptions(selfController: ChatControllerImpl, sourceNode: ASD
|
|||||||
items.append(.separator)
|
items.append(.separator)
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO:localize
|
items.append(.action(ContextMenuActionItem(text: selfController.presentationData.strings.Conversation_MessageOptionsApplyChanges, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Select"), color: theme.contextMenu.primaryColor) }, action: { _, f in
|
||||||
items.append(.action(ContextMenuActionItem(text: "Apply Changes", icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Select"), color: theme.contextMenu.primaryColor) }, action: { _, f in
|
|
||||||
f(.default)
|
f(.default)
|
||||||
})))
|
})))
|
||||||
|
|
||||||
//TODO:localize
|
items.append(.action(ContextMenuActionItem(text: selfController.presentationData.strings.Conversation_LinkOptionsCancel, textColor: .destructive, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Delete"), color: theme.contextMenu.destructiveColor) }, action: { [weak selfController, weak chatController] c, f in
|
||||||
items.append(.action(ContextMenuActionItem(text: "Do Not Preview", textColor: .destructive, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Delete"), color: theme.contextMenu.destructiveColor) }, action: { [weak selfController, weak chatController] c, f in
|
|
||||||
guard let selfController else {
|
guard let selfController else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -921,10 +894,9 @@ private func chatLinkOptions(selfController: ChatControllerImpl, sourceNode: ASD
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO:localize
|
|
||||||
return ContextController.Source(
|
return ContextController.Source(
|
||||||
id: AnyHashable(OptionsId.link),
|
id: AnyHashable(OptionsId.link),
|
||||||
title: "Link",
|
title: selfController.presentationData.strings.Conversation_MessageOptionsTabLink,
|
||||||
source: .controller(ChatContextControllerContentSourceImpl(controller: chatController, sourceNode: sourceNode, passthroughTouches: true)),
|
source: .controller(ChatContextControllerContentSourceImpl(controller: chatController, sourceNode: sourceNode, passthroughTouches: true)),
|
||||||
items: items
|
items: items
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4950,18 +4950,17 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
guard let self else {
|
guard let self else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
//TODO:localize
|
|
||||||
let text: String
|
let text: String
|
||||||
if let peer = peer as? TelegramChannel {
|
if let peer = peer as? TelegramChannel {
|
||||||
if case .broadcast = peer.info {
|
if case .broadcast = peer.info {
|
||||||
text = "This quote is from a private channel"
|
text = self.presentationData.strings.Chat_ToastQuoteChatUnavailbalePrivateChannel
|
||||||
} else {
|
} else {
|
||||||
text = "This quote is from a private group"
|
text = self.presentationData.strings.Chat_ToastQuoteChatUnavailbalePrivateGroup
|
||||||
}
|
}
|
||||||
} else if peer is TelegramGroup {
|
} else if peer is TelegramGroup {
|
||||||
text = "This quote is from a private group"
|
text = self.presentationData.strings.Chat_ToastQuoteChatUnavailbalePrivateGroup
|
||||||
} else {
|
} else {
|
||||||
text = "This quote is from a private chat"
|
text = self.presentationData.strings.Chat_ToastQuoteChatUnavailbalePrivateChat
|
||||||
}
|
}
|
||||||
self.controllerInteraction?.displayUndo(.info(title: nil, text: text, timeout: nil, customUndoText: nil))
|
self.controllerInteraction?.displayUndo(.info(title: nil, text: text, timeout: nil, customUndoText: nil))
|
||||||
}, automaticMediaDownloadSettings: self.automaticMediaDownloadSettings, pollActionState: ChatInterfacePollActionState(), stickerSettings: self.stickerSettings, presentationContext: ChatPresentationContext(context: context, backgroundNode: self.chatBackgroundNode))
|
}, automaticMediaDownloadSettings: self.automaticMediaDownloadSettings, pollActionState: ChatInterfacePollActionState(), stickerSettings: self.stickerSettings, presentationContext: ChatPresentationContext(context: context, backgroundNode: self.chatBackgroundNode))
|
||||||
@@ -5294,15 +5293,13 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
if !selectionState.canQuote {
|
if !selectionState.canQuote {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
//TODO:localize
|
return presentationData.strings.Chat_SubtitleQuoteSelectionTip
|
||||||
return "You can select a specific part to quote"
|
|
||||||
}
|
}
|
||||||
case let .link(link):
|
case let .link(link):
|
||||||
subtitleTextSignal = link.options
|
subtitleTextSignal = link.options
|
||||||
|> map { options -> String? in
|
|> map { options -> String? in
|
||||||
if options.hasAlternativeLinks {
|
if options.hasAlternativeLinks {
|
||||||
//TODO:localize
|
return presentationData.strings.Chat_SubtitleLinkListTip
|
||||||
return "Tap on a link to generate its preview"
|
|
||||||
} else {
|
} else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -5354,12 +5351,11 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
if let peer = peerViewMainPeer(peerView) {
|
if let peer = peerViewMainPeer(peerView) {
|
||||||
if case let .messageOptions(_, _, info) = presentationInterfaceState.subject {
|
if case let .messageOptions(_, _, info) = presentationInterfaceState.subject {
|
||||||
if case .reply = info {
|
if case .reply = info {
|
||||||
//TODO:localize
|
|
||||||
let titleContent: ChatTitleContent
|
let titleContent: ChatTitleContent
|
||||||
if case let .reply(hasQuote) = messageOptionsTitleInfo, hasQuote {
|
if case let .reply(hasQuote) = messageOptionsTitleInfo, hasQuote {
|
||||||
titleContent = .custom("Reply to Quote", subtitleText, false)
|
titleContent = .custom(presentationInterfaceState.strings.Chat_TitleQuoteSelection, subtitleText, false)
|
||||||
} else {
|
} else {
|
||||||
titleContent = .custom("Reply to Message", subtitleText, false)
|
titleContent = .custom(presentationInterfaceState.strings.Chat_TitleReply, subtitleText, false)
|
||||||
}
|
}
|
||||||
if strongSelf.chatTitleView?.titleContent != titleContent {
|
if strongSelf.chatTitleView?.titleContent != titleContent {
|
||||||
if strongSelf.chatTitleView?.titleContent != nil {
|
if strongSelf.chatTitleView?.titleContent != nil {
|
||||||
@@ -5368,8 +5364,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
strongSelf.chatTitleView?.titleContent = titleContent
|
strongSelf.chatTitleView?.titleContent = titleContent
|
||||||
}
|
}
|
||||||
} else if case .link = info {
|
} else if case .link = info {
|
||||||
//TODO:localize
|
strongSelf.chatTitleView?.titleContent = .custom(presentationInterfaceState.strings.Chat_TitleLinkOptions, subtitleText, false)
|
||||||
strongSelf.chatTitleView?.titleContent = .custom("Link Preview Settings", subtitleText, false)
|
|
||||||
} else if displayedCount == 1 {
|
} else if displayedCount == 1 {
|
||||||
strongSelf.chatTitleView?.titleContent = .custom(presentationInterfaceState.strings.Conversation_ForwardOptions_ForwardTitleSingle, subtitleText, false)
|
strongSelf.chatTitleView?.titleContent = .custom(presentationInterfaceState.strings.Conversation_ForwardOptions_ForwardTitleSingle, subtitleText, false)
|
||||||
} else {
|
} else {
|
||||||
@@ -8033,8 +8028,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
if message.text.contains(quote) {
|
if message.text.contains(quote) {
|
||||||
hasQuote = true
|
hasQuote = true
|
||||||
} else {
|
} else {
|
||||||
//TODO:localize
|
strongSelf.present(UndoOverlayController(presentationData: strongSelf.presentationData, content: .info(title: nil, text: strongSelf.presentationData.strings.Chat_ToastQuoteNotFound, timeout: nil, customUndoText: nil), elevatedLayout: false, action: { _ in return true }), in: .current)
|
||||||
strongSelf.present(UndoOverlayController(presentationData: strongSelf.presentationData, content: .info(title: nil, text: "Quote not found", timeout: nil, customUndoText: nil), elevatedLayout: false, action: { _ in return true }), in: .current)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3401,7 +3401,6 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !found {
|
if !found {
|
||||||
//TODO:localize
|
|
||||||
let authorName: String = (replyMessage.author.flatMap(EnginePeer.init))?.compactDisplayTitle ?? ""
|
let authorName: String = (replyMessage.author.flatMap(EnginePeer.init))?.compactDisplayTitle ?? ""
|
||||||
let errorTextData = self.chatPresentationInterfaceState.strings.Chat_ErrorQuoteOutdatedText(authorName)
|
let errorTextData = self.chatPresentationInterfaceState.strings.Chat_ErrorQuoteOutdatedText(authorName)
|
||||||
let errorText = errorTextData.string
|
let errorText = errorTextData.string
|
||||||
|
|||||||
@@ -3710,8 +3710,7 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate, Ch
|
|||||||
|
|
||||||
var children: [UIAction] = []
|
var children: [UIAction] = []
|
||||||
|
|
||||||
//TODO:localize
|
children.append(UIAction(title: self.strings?.TextFormat_Quote ?? "Quote", image: nil) { [weak self] (action) in
|
||||||
children.append(UIAction(title: "Quote", image: nil) { [weak self] (action) in
|
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
strongSelf.formatAttributesQuote(strongSelf)
|
strongSelf.formatAttributesQuote(strongSelf)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -740,8 +740,7 @@ public final class TextSelectionNode: ASDisplayNode {
|
|||||||
|
|
||||||
let realFullRange = NSRange(location: 0, length: attributedString.length)
|
let realFullRange = NSRange(location: 0, length: attributedString.length)
|
||||||
if range != realFullRange {
|
if range != realFullRange {
|
||||||
//TODO:localize
|
actions.append(ContextMenuAction(content: .text(title: self.strings.TextSelection_SelectAll, accessibilityLabel: self.strings.TextSelection_SelectAll), action: { [weak self] in
|
||||||
actions.append(ContextMenuAction(content: .text(title: "Select All", accessibilityLabel: "Select All"), action: { [weak self] in
|
|
||||||
guard let self else {
|
guard let self else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user