From 8eeb177c7e03766575479a33644a29d99f0795a5 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Fri, 23 Apr 2021 08:46:32 +0200 Subject: [PATCH] Use textwarp to check the message length and rows @DRracer: Added origial English text to the output, added cols and rows as well --- lang/lang-check.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lang/lang-check.py b/lang/lang-check.py index 9446d827f..1e6ff5195 100755 --- a/lang/lang-check.py +++ b/lang/lang-check.py @@ -4,11 +4,12 @@ # ############################################################################# # Change log: -# 7 May 2019, Ondrej Tuma, Initial -# 9 June 2020, 3d-gussner, Added version and Change log -# 9 June 2020, 3d-gussner, Wrap text to 20 char and rows -# 9 June 2020, 3d-gussner, colored output -# 2 Apr. 2021, 3d-gussner, Fix and improve text warp +# 7 May 2019, Ondrej Tuma, Initial +# 9 June 2020, 3d-gussner, Added version and Change log +# 9 June 2020, 3d-gussner, Wrap text to 20 char and rows +# 9 June 2020, 3d-gussner, colored output +# 2 Apr. 2021, 3d-gussner, Fix and improve text warp +# 22 Apr. 2021, DRracer, add English source to output ############################################################################# # """Check lang files.""" @@ -76,7 +77,8 @@ def parse_txt(lang, no_warning): rows = 1 if rows_count_translation > rows_count_source and rows_count_translation > rows: - print(red("[E]: Text %s is longer then definiton on line %d rows diff=%d, EN=%s\n" % (translation, lines, rows_count_translation-rows, source))) + print(red("[E]: Text %s is longer then definition on line %d rows diff=%d\n[EN]:Text %s cols=%d rows=%d\n" % (translation, lines, rows_count_translation-rows, source, cols, rows))) + if len(src.readline()) != 1: # empty line break