Пример #1
0
 def po2csv(self, posource):
     """helper that converts po source to csv source without requiring files"""
     inputfile = wStringIO.StringIO(posource)
     inputpo = po.pofile(inputfile)
     convertor = po2csv.po2csv()
     outputcsv = convertor.convertstore(inputpo)
     return outputcsv
Пример #2
0
 def po2csv(self, posource):
     """helper that converts po source to csv source without requiring files"""
     inputfile = wStringIO.StringIO(posource)
     inputpo = po.pofile(inputfile)
     convertor = po2csv.po2csv()
     outputcsv = convertor.convertstore(inputpo)
     return outputcsv
Пример #3
0
    def extract_loc(self, locale, no_csv):
        self.extract_text()

        for loc in locale:
            loc_dir = os.path.join(TRANSLATIONS, loc)
            if os.path.isdir(loc_dir):
                self.update_catalog(loc)
            else:
                os.makedirs(loc_dir)
                self.init_catalog(loc)

            if not no_csv:
                base = os.path.join(TRANSLATIONS, loc, 'LC_MESSAGES')
                po = os.path.join(base, 'messages.po')
                csv = os.path.join(base, 'messages.csv')
                po2csv([po, csv])

        self.compile_catalog()
Пример #4
0
 def po2csv(self, posource):
     """helper that converts po source to csv source without requiring files"""
     inputfile = BytesIO(posource.encode())
     inputpo = po.pofile(inputfile)
     convertor = po2csv.po2csv()
     return convertor.convertstore(inputpo)