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
Exemple #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
Exemple #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))
Exemple #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))
Exemple #5
0
import glob, po2dict, shutil

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

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