Пример #1
0
 def po2tmx(self, posource, sourcelanguage='en', targetlanguage='af',
            comment=None):
     """helper that converts po source to tmx source without requiring files"""
     inputfile = BytesIO(posource.encode('utf-8'))
     outputfile = BytesIO()
     outputfile.tmxfile = tmx.tmxfile(inputfile=None, sourcelanguage=sourcelanguage)
     po2tmx.convertpo(inputfile, outputfile, templatefile=None,
                      sourcelanguage=sourcelanguage,
                      targetlanguage=targetlanguage, comment=comment)
     return outputfile.tmxfile
Пример #2
0
 def po2tmx(self, posource, sourcelanguage='en', targetlanguage='af',
            comment=None):
     """helper that converts po source to tmx source without requiring files"""
     inputfile = BytesIO(posource.encode('utf-8'))
     outputfile = BytesIO()
     outputfile.tmxfile = tmx.tmxfile(inputfile=None, sourcelanguage=sourcelanguage)
     po2tmx.convertpo(inputfile, outputfile, templatefile=None,
                      sourcelanguage=sourcelanguage,
                      targetlanguage=targetlanguage, comment=comment)
     return outputfile.tmxfile
Пример #3
0
 def po2tmx(posource,
            sourcelanguage="en",
            targetlanguage="af",
            comment=None):
     """helper that converts po source to tmx source without requiring files"""
     inputfile = BytesIO(posource.encode("utf-8"))
     outputfile = BytesIO()
     outputfile.tmxfile = tmx.tmxfile(inputfile=None,
                                      sourcelanguage=sourcelanguage)
     po2tmx.convertpo(
         inputfile,
         outputfile,
         templatefile=None,
         sourcelanguage=sourcelanguage,
         targetlanguage=targetlanguage,
         comment=comment,
     )
     return outputfile.tmxfile