From e3ec295a0e785acb6fe78bf1d6e9d971acd4be18 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Fri, 23 Apr 2021 23:58:11 +0200 Subject: [PATCH] lang-check: add checks for % escapes --- lang/lang-check.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lang/lang-check.py b/lang/lang-check.py index e6d41b65..830d6feb 100755 --- a/lang/lang-check.py +++ b/lang/lang-check.py @@ -150,6 +150,13 @@ def parse_txt(lang, no_warning): wrapped_source, wrapped_translation, rows, cols) + # Different count of % sequences + if source.count('%') != translation.count('%') and len(translation) > 0: + print(red('[E]: Unequal count of %% escapes line %d:' % (lines))) + print_source_translation(source, translation, + wrapped_source, wrapped_translation, + rows, cols) + # Different first/last character if not no_warning and len(source) > 0 and len(translation) > 0: source_end = source.strip()[-1]