Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios

This commit is contained in:
Ilya Laktyushin 2022-04-07 12:19:32 +04:00
commit 85faae8a2c
4 changed files with 6 additions and 26 deletions

View File

@ -806,6 +806,10 @@ public class AttachmentController: ViewController {
}
}
deinit {
print()
}
public required init(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

@ -1 +1 @@
Subproject commit aa4d82d73a84429b9955401bc8bb17ea92f30555
Subproject commit b7460dd9572173aed1e3838f5eb33b813a1e6b31

View File

@ -175,30 +175,6 @@ public func canTranslateText(context: AccountContext, text: String, showTranslat
}
}
public func translateText(context: AccountContext, text: String, fromLang: String? = nil) {
guard !text.isEmpty else {
return
}
if #available(iOS 15.0, *) {
let text = text.unicodeScalars.filter { !$0.properties.isEmojiPresentation }.reduce("") { $0 + String($1) }
let textView = UITextView()
textView.text = text
textView.isEditable = false
if let navigationController = context.sharedContext.mainWindow?.viewController as? NavigationController, let topController = navigationController.topViewController as? ViewController {
topController.view.addSubview(textView)
textView.selectAll(nil)
DispatchQueue.main.async {
textView.removeFromSuperview()
}
}
let toLang = context.sharedContext.currentPresentationData.with { $0 }.strings.baseLanguageCode
let _ = context.engine.messages.translate(text: text, fromLang: fromLang, toLang: toLang).start()
}
}
public struct TextTranslationResult: Equatable {
let text: String
let detectedLanguage: String?

View File

@ -1,5 +1,5 @@
{
"app": "8.6",
"app": "8.7",
"bazel": "5.1.0",
"xcode": "13.2.1"
}