Skip to content

Commit

Permalink
Tools: Made updatets delete temporary json files
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Oct 28, 2020
1 parent 0f87516 commit c3672f6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Tools/updatets.py
Expand Up @@ -187,6 +187,7 @@ def update_translation(path):
global QMAKE, LUPDATE
cur = os.getcwd()
os.chdir(path)
existingjsons = [f for f in os.listdir(".") if f.endswith(".json")]
filename = os.path.basename(path) + ".pro"
os.system(QMAKE + " -project")
#os.system(LUPDATE + " " + filename)
Expand All @@ -198,6 +199,10 @@ def update_translation(path):
tsname = " -ts "+os.path.join("Language", "FreeCAD.ts")
os.system(LUPDATE + " " + filename + tsname)
os.remove(filename)
# lupdate creates json files since Qt5.something. Remove them here too
for jsonfile in [f for f in os.listdir(".") if f.endswith(".json")]:
if not jsonfile in existingjsons:
os.remove(jsonfile)
os.chdir(cur)

def update_python_translation(item):
Expand Down

0 comments on commit c3672f6

Please sign in to comment.