From aa57a17af61b800330f801fa5c1eb4ff169aa23a Mon Sep 17 00:00:00 2001 From: AlexeyZavar Date: Wed, 5 Nov 2025 10:19:52 +0300 Subject: [PATCH] fix: line separators in google translator --- .../ayu/features/translator/implementations/google.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/ayu/features/translator/implementations/google.cpp b/Telegram/SourceFiles/ayu/features/translator/implementations/google.cpp index 9284b7deaa..94451417b6 100644 --- a/Telegram/SourceFiles/ayu/features/translator/implementations/google.cpp +++ b/Telegram/SourceFiles/ayu/features/translator/implementations/google.cpp @@ -88,7 +88,10 @@ QPointer GoogleTranslator::startSingleTranslation( const auto from = fromLang.trimmed().isEmpty() ? QStringLiteral("auto") : fromLang.trimmed(); const auto to = toLang.trimmed(); - const auto preparedText = shouldWrapInHtml() ? Html::entitiesToHtml(text) : text.text; + auto textToTranslate = text.text; + textToTranslate = textToTranslate.replace(qsl("\n"), qsl("
")); + + const auto preparedText = textToTranslate; QJsonArray requestRoot; QJsonArray requestPayload; QJsonArray requestText;