mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
strip whitespace in extracted strings
This commit is contained in:
parent
da86c27d05
commit
f4d38f579d
1 changed files with 2 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue