mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-03 07:56:03 +00:00
Fixed first check for skipping translation.
This commit is contained in:
@@ -317,11 +317,10 @@ bool SkipTranslate(TextWithEntities textWithEntities) {
|
|||||||
if (!Core::App().settings().translateButtonEnabled()) {
|
if (!Core::App().settings().translateButtonEnabled()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
auto hasLetters = false;
|
constexpr auto kFirstChunk = size_t(100);
|
||||||
constexpr auto kFirstChunk = 100;
|
auto hasLetters = (text.size() >= kFirstChunk);
|
||||||
for (auto i = 0; i < kFirstChunk; i++) {
|
for (auto i = 0; i < kFirstChunk; i++) {
|
||||||
if (i >= text.size()) {
|
if (i >= text.size()) {
|
||||||
hasLetters = true; // Rest characters are unknown.
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (text.at(i).isLetter()) {
|
if (text.at(i).isLetter()) {
|
||||||
|
Reference in New Issue
Block a user