mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Fix comparisons when source is single-line but dest is multi-line
Or vice-versa. It's now agnostic to number of lines. Contributes to issue CURA-6663.
This commit is contained in:
parent
9e059b7a1a
commit
79d57ec10a
1 changed files with 5 additions and 4 deletions
|
@ -146,10 +146,11 @@ def find_translation(source: str, msgctxt: str, msgid: str) -> str:
|
|||
last_source[current_state] += line + "\n"
|
||||
else: #White lines trigger us to process this translation. Is it the correct one?
|
||||
#Process the source and destination keys for comparison independent of newline technique.
|
||||
source_ctxt = "".join((line.strip()[1:-1].strip() for line in last_source["msgctxt"].split("\n")))
|
||||
source_id = "".join((line.strip()[1:-1].strip() for line in last_source["msgid"].split("\n")))
|
||||
dest_ctxt = "".join((line.strip()[1:-1].strip() for line in msgctxt.split("\n")))
|
||||
dest_id = "".join((line.strip()[1:-1].strip() for line in msgid.split("\n")))
|
||||
source_ctxt = "".join((line.strip()[1:-1] for line in last_source["msgctxt"].split("\n")))
|
||||
source_id = "".join((line.strip()[1:-1] for line in last_source["msgid"].split("\n")))
|
||||
dest_ctxt = "".join((line.strip()[1:-1] for line in msgctxt.split("\n")))
|
||||
dest_id = "".join((line.strip()[1:-1] for line in msgid.split("\n")))
|
||||
|
||||
if source_ctxt == dest_ctxt and source_id == dest_id:
|
||||
if last_source["msgstr"] == "\"\"\n":
|
||||
print("!!! Empty translation for {" + dest_ctxt + "}", dest_id, "!!!")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue