From e06cc2db6ea1b6561629dd8e21e8cc7c19e1e7d0 Mon Sep 17 00:00:00 2001 From: Anton Titovets Date: Sat, 13 Dec 2025 19:30:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D1=81=D0=BA=D1=80=D0=B8=D0=BF=D1=82=D0=B0=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B8=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D0=B2=D0=BE=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ci/lua/translate_scanner.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ci/lua/translate_scanner.lua b/ci/lua/translate_scanner.lua index ef1fd605b4..56d0ad46bd 100644 --- a/ci/lua/translate_scanner.lua +++ b/ci/lua/translate_scanner.lua @@ -91,14 +91,21 @@ function table_length(t) return count end +-- Экранирование специальных символов для string.gsub +function escape_pattern(text) + return string.gsub(text, "([%.%+%-%*%?%[%]%^%$%(%)%%])", "%%%1") +end + function has_untranslated_cyrillic(line, translation_dict) local cleaned_line = line for key, value in pairs(translation_dict) do if has_cyrillic(key) then - cleaned_line = string.gsub(cleaned_line, key, "") + local escaped_key = escape_pattern(key) + cleaned_line = string.gsub(cleaned_line, escaped_key, "") end if has_cyrillic(value) then + local escaped_value = escape_pattern(value) cleaned_line = string.gsub(cleaned_line, value, "") end end