From f4d38f579d5616646333fe9d1a2a158b12c2de31 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 27 Feb 2020 17:38:02 +1000 Subject: [PATCH] strip whitespace in extracted strings --- qt/po/scripts/extract-po-string.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qt/po/scripts/extract-po-string.py b/qt/po/scripts/extract-po-string.py index 83ec1a51d..3183aede9 100644 --- a/qt/po/scripts/extract-po-string.py +++ b/qt/po/scripts/extract-po-string.py @@ -37,7 +37,7 @@ def get_msgstr(entry): if replacements: for (old, new) in replacements: msg = msg.replace(old, f"{{{new}}}") - return msg + return msg.strip() # plural string and non-empty? elif entry.msgstr_plural and entry.msgstr_plural[0]: # convert the dict into a list in the correct order @@ -49,7 +49,7 @@ def get_msgstr(entry): if replacements: for (old, new) in replacements: msg = msg.replace(old, f"{{{new}}}") - adjusted.append(msg) + adjusted.append(msg.strip()) if len(adjusted) > 1 and adjusted[0]: return adjusted else: