mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fixed first check for skipping translation.
This commit is contained in:
parent
7cdc3eb2b2
commit
f9a14fc6bc
1 changed files with 2 additions and 3 deletions
|
@ -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()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue