summaryrefslogtreecommitdiff
path: root/lang/updatelang.py
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-03-06 14:30:40 +0300
committerAndrei Karas <akaras@inbox.ru>2015-03-06 14:30:40 +0300
commitfe0253fe089a7cc50c8cea8d39ecfcfccd3d1390 (patch)
treeb3c275fd6d7518567e9ee32b4ff5d49238994fe5 /lang/updatelang.py
parent8ba994b91015d5f9c0bc227632db8db518a955f3 (diff)
downloadevol-tools-fe0253fe089a7cc50c8cea8d39ecfcfccd3d1390.tar.gz
evol-tools-fe0253fe089a7cc50c8cea8d39ecfcfccd3d1390.tar.bz2
evol-tools-fe0253fe089a7cc50c8cea8d39ecfcfccd3d1390.tar.xz
evol-tools-fe0253fe089a7cc50c8cea8d39ecfcfccd3d1390.zip
lang: fix minor issues in code.
Diffstat (limited to 'lang/updatelang.py')
-rwxr-xr-xlang/updatelang.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/lang/updatelang.py b/lang/updatelang.py
index d608caa..e97e172 100755
--- a/lang/updatelang.py
+++ b/lang/updatelang.py
@@ -113,7 +113,8 @@ def parseFile(name, readFirstLine):
def loadPoFiles(podir):
files = os.listdir(podir)
for name in files:
- parsePoFile(name[:-3], podir + "/" + name)
+ if name[-3:] == ".po":
+ parsePoFile(name[:-3], podir + "/" + name)
def parsePoFile(name, path):
@@ -202,13 +203,13 @@ def sortDict(adict):
d2.append ((key, adict[0][key]))
return (d2, adict[1])
-def saveFiles(dir):
+def saveFiles(langDir):
for trans in langFiles:
- writeFile (dir + "/lang_" + trans + ".txt", langFiles[trans], trans, False)
- writeFile (dir + "/lang_" + trans + ".old", oldLangFiles[trans], trans, True)
+ writeFile (langDir + "/lang_" + trans + ".txt", langFiles[trans], trans, False)
+ writeFile (langDir + "/lang_" + trans + ".old", oldLangFiles[trans], trans, True)
-def writeFile(dir, texts, trans, isold):
- with open (dir, "w") as f:
+def writeFile(langDir, texts, trans, isold):
+ with open (langDir, "w") as f:
if texts[1] is not None:
f.write(texts[1])
for line in texts[0]: