Merge pull request #5318 from chennes/lupdateCPPWorkaround

Tools: Add workaround for lupdate missing source
This commit is contained in:
Yorik van Havre
2022-01-10 11:13:43 +01:00
committed by GitHub

View File

@@ -153,6 +153,7 @@ def update_translation(entry):
tsBasename = os.path.join(entry["tsdir"],entry["tsname"])
execline = []
execline.append (f"touch dummy_cpp_file_for_lupdate.cpp") #lupdate requires at least one source file to process the UI files
execline.append (f"{QMAKE} -project -o {project_filename}")
execline.append (f"sed 's/<translation.*>.*<\/translation>/<translation type=\"unfinished\"><\/translation>/g' {tsBasename}.ts > {tsBasename}.ts.temp")
execline.append (f"touch {tsBasename}.ts") # In case it didn't get created above
@@ -161,6 +162,7 @@ def update_translation(entry):
execline.append (f"{PYLUPDATE} `find ./ -name \"*.py\"` -ts {tsBasename}py.ts {log_redirect}")
execline.append (f"{LCONVERT} -i {tsBasename}py.ts {tsBasename}.ts -o {tsBasename}.ts {log_redirect}")
execline.append (f"rm {tsBasename}py.ts")
execline.append (f"rm dummy_cpp_file_for_lupdate.cpp")
print(f"Executing special commands in {entry['workingdir']}:")
for line in execline:
print (line)