mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-26 15:31:12 +00:00
bug fixes
This commit is contained in:
parent
fd324106e3
commit
e15f0982cb
@ -11,6 +11,7 @@ public enum TranslationError {
|
||||
case textTooLong
|
||||
case invalidLanguage
|
||||
case limitExceeded
|
||||
case tryAlternative
|
||||
}
|
||||
|
||||
func _internal_translate(network: Network, text: String, toLang: String, entities: [MessageTextEntity] = []) -> Signal<(String, [MessageTextEntity])?, TranslationError> {
|
||||
@ -29,6 +30,8 @@ func _internal_translate(network: Network, text: String, toLang: String, entitie
|
||||
return .textTooLong
|
||||
} else if error.errorDescription == "TO_LANG_INVALID" {
|
||||
return .invalidLanguage
|
||||
} else if error.errorDescription == "TRANSLATIONS_DISABLED_ALT" {
|
||||
return .tryAlternative
|
||||
} else {
|
||||
return .generic
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user