Reorganising files for auto generation of PO/MO

This commit is contained in:
Andrew Williams
2009-01-17 23:27:41 +00:00
parent 05ab9f8f07
commit c2eddc3a6c
5 changed files with 7 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
#! /usr/bin/env python
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
#
# PYTHON MODULE: MKI18N.PY
@@ -232,19 +232,19 @@ def makeMO(applicationDirectoryPath,targetDir='./locale',applicationDomain=None,
applicationName = applicationDomain
currentDir = os.getcwd()
os.chdir(applicationDirectoryPath)
languageDict = getlanguageDict()
for langCode in languageDict.keys():
if (langCode == 'en') and (forceEnglish==0):
pass
else:
langPOfileName = "%s_%s.po" % (applicationName , langCode)
else:
print langCode
langPOfileName = "./pofiles/%s_%s.po" % (applicationName , langCode)
if os.path.exists(langPOfileName):
mo_targetDir = "%s/%s/LC_MESSAGES" % (targetDir,langCode)
if not os.path.exists(mo_targetDir):
mkdir(mo_targetDir)
cmd = 'msgfmt --output-file="%s/%s.mo" "%s_%s.po"' % (mo_targetDir,applicationName,applicationName,langCode)
cmd = 'msgfmt --output-file="%s/%s.mo" "%s"' % (mo_targetDir,applicationName, langPOfileName)
if verbose: print cmd
os.system(cmd)
os.chdir(currentDir)