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