update_all.py 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. import os
  2. import sys
  3. import subprocess
  4. languages = ["cs", "de", "en","es", "fr", "it", "ja", "ko", "nl", "pl", "pt_br", "ru", "tr", "uk", "zh_cn", "zh_tw"];
  5. print(sys.getrecursionlimit())
  6. for lang in languages:
  7. if 'y' != input("translating "+lang+"? (y/n): "):
  8. continue
  9. # create .po
  10. #os.system("msgunfmt "+lang+"/Slic3r.mo -o "+lang+"/SuperSlicer.po > nul");
  11. #os.system("copy ..\\loc\\"+lang+"\\*.po "+lang+"\\PrusaSlicer.po");
  12. file_out_stream = open(lang+"/settings.ini", mode="w", encoding="utf-8");
  13. file_out_stream.write("data = ./PrusaSlicer.po\n");
  14. file_out_stream.write("ui_dir = ../../ui_layout\n");
  15. file_out_stream.write("ignore_case = true\n");
  16. file_out_stream.write("input = ../Slic3r.pot\n");
  17. file_out_stream.write("todo = ./todo.po\n");
  18. file_out_stream.write("output = ./Slic3r.po\n");
  19. #flush
  20. file_out_stream.close();
  21. p = subprocess.Popen(["python","../pom_merger.py"], cwd=lang);
  22. p.wait();
  23. for file in os.listdir(lang):
  24. if not file.endswith("Slic3r.po"):
  25. os.remove(lang + "/" + file);
  26. # #create .mo
  27. # os.system("msgfmt "+lang+"/SuperSlicer.po -o "+lang+"/SuperSlicer.mo");
  28. # #msgfmt Slic3r.po -o Slic3r.mo