blob: 38f9cb47e00d520356743a998d3fdfd36ae20e14 [file] [log] [blame]
Edric Milaret45e26d22016-05-06 12:09:17 -04001#!/usr/bin/python
2
3import os
4import shutil
5
6print ("Pulling translations")
7
8os.system("tx pull -af --minimum-perc=30")
9
10print ("Updating .pro file")
11
12translationFiles = []
13
14for filename in os.listdir('./translations'):
15 translationFiles.append("translations/{0}".format(filename))
16
17proFile = "RingWinClient.pro"
18shutil.move(proFile, proFile + "~")
19
20destination = open(proFile, "w")
21source = open(proFile + "~", "r")
22for line in source:
23 if not ".ts" in line:
24 destination.write(line)
25 if "TRANSLATIONS = " in line:
26 for filename in translationFiles:
27 destination.write(" {0} \\\n".format(filename))
28
29source.close()
30destination.close()
31os.remove(proFile + "~")
32
33print ("Updating translations")
34
35os.system("lupdate RingWinClient.pro")
36
37print ("All done you can commit now")