def _loadPoFile(self, poFilename):
     ''' Load the translation from a .po file by creating a python 
         module with po2dict and them importing that module. ''' 
     language = self._languageFromPoFilename(poFilename)
     pyFilename = self._tmpPyFilename()
     po2dict.make(poFilename, pyFilename)
     module = imp.load_source(language, pyFilename)
     os.remove(pyFilename)
     return module, language
示例#2
0
 def _loadPoFile(self, poFilename):
     ''' Load the translation from a .po file by creating a python 
         module with po2dict and them importing that module. '''
     language = self._languageFromPoFilename(poFilename)
     pyFilename = self._tmpPyFilename()
     po2dict.make(poFilename, pyFilename)
     module = imp.load_source(language, pyFilename)
     os.remove(pyFilename)
     return module, language
示例#3
0
def processDir(outdir):
    catalogs = ['en_US']
    for poFile in glob.glob('i18n.in/*.po'):
        print poFile
        pyFile = po2dict.make(poFile)
        shutil.move(pyFile, '%s/%s' % (outdir, os.path.basename(pyFile)))

        catalogs.append(os.path.splitext(os.path.basename(pyFile))[0])

    fh = open('%s/%s' % (outdir, 'peppy_message_catalogs.py'), 'w')
    fh.write("supplied_translations = %s" % str(catalogs))
示例#4
0
def processDir(outdir):
    catalogs = ['en_US']
    for poFile in glob.glob('i18n.in/*.po'):
        print poFile
        pyFile = po2dict.make(poFile)
        shutil.move(pyFile, '%s/%s' % (outdir, os.path.basename(pyFile)))
        
        catalogs.append(os.path.splitext(os.path.basename(pyFile))[0])
    
    fh = open('%s/%s' % (outdir, 'peppy_message_catalogs.py'), 'w')
    fh.write("supplied_translations = %s" % str(catalogs))
示例#5
0
文件: make.py 项目: zendbit/peppy
import glob, po2dict, shutil

for poFile in glob.glob('*.po'):
    print poFile
    pyFile = po2dict.make(poFile)
    shutil.move(pyFile, '../peppy/i18n/%s' % pyFile)
示例#6
0
文件: make.py 项目: betsegaw/peppy
import glob, po2dict, shutil

for poFile in glob.glob('*.po'):
    print poFile
    pyFile = po2dict.make(poFile)
    shutil.move(pyFile, '../peppy/i18n/%s'%pyFile)