From 2ceb3897f15ea487b2b51840c0dc52b1f1864111 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Fri, 23 Apr 2021 22:49:00 +0200 Subject: [PATCH] lang-check: respect --no-warning --- lang/lang-check.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lang/lang-check.py b/lang/lang-check.py index bd073e2b..287189ea 100755 --- a/lang/lang-check.py +++ b/lang/lang-check.py @@ -113,14 +113,15 @@ def parse_txt(lang, no_warning): #End wrap text # Check for potential errors in the definition - if rows == 1 and (len(source) > cols or rows_count_source > rows): - print(yellow('[W]: Source text longer than %d cols as defined on line %d:' % (cols, lines))) - print_truncated(source, cols) - print() - elif rows_count_source > rows: - print(yellow('[W]: Wrapped source text longer than %d rows as defined on line %d:' % (rows, lines))) - print_wrapped(wrapped_source, rows, cols) - print() + if not no_warning: + if rows == 1 and (len(source) > cols or rows_count_source > rows): + print(yellow('[W]: Source text longer than %d cols as defined on line %d:' % (cols, lines))) + print_truncated(source, cols) + print() + elif rows_count_source > rows: + print(yellow('[W]: Wrapped source text longer than %d rows as defined on line %d:' % (rows, lines))) + print_wrapped(wrapped_source, rows, cols) + print() # Check for translation lenght if (rows_count_translation > rows) or (rows == 1 and len(translation) > cols):