| 1 | #!env python |
| 2 | |
| 3 | import sys,os,fnmatch |
| 4 | from subprocess import call |
| 5 | |
| 6 | translations_dir = os.getcwd() + "/translations" |
| 7 | if (len(sys.argv) == 2): |
| 8 | translations_dir = sys.argv[1] + "/translations" |
| 9 | |
| 10 | print("set translations dir:", translations_dir) |
| 11 | |
| 12 | tslist = fnmatch.filter(os.listdir(translations_dir), '*.ts') |
| 13 | |
| 14 | # This would print all the files and directories |
| 15 | for tsfile in tslist: |
| 16 | tspath = translations_dir + "/" + tsfile |
| 17 | print ("process", tspath) |
| 18 | call(["lrelease", tspath]) |