コード例 #1
0
ファイル: gettext.py プロジェクト: dekoza/weblate
 def pre_commit(self, translation, author):
     exporter = MoExporter(translation=translation)
     exporter.add_units(translation.unit_set.all())
     output = translation.get_filename()[:-2] + 'mo'
     with open(output, 'wb') as handle:
         handle.write(exporter.serialize())
     translation.addon_commit_files.append(output)
コード例 #2
0
 def pre_commit(self, translation, author):
     exporter = MoExporter(translation=translation)
     exporter.add_units(translation.unit_set.all())
     output = translation.get_filename()[:-2] + 'mo'
     with open(output, 'wb') as handle:
         handle.write(exporter.serialize())
     translation.addon_commit_files.append(output)
コード例 #3
0
ファイル: gettext.py プロジェクト: rheehot/weblate
    def pre_commit(self, translation, author):
        exporter = MoExporter(translation=translation)
        exporter.add_units(translation.unit_set.all())

        template = self.instance.configuration.get("path")
        if not template:
            template = "{{ filename|stripext }}.mo"

        output = self.render_repo_filename(template, translation)
        if not output:
            return

        with open(output, "wb") as handle:
            handle.write(exporter.serialize())
        translation.addon_commit_files.append(output)
コード例 #4
0
ファイル: gettext.py プロジェクト: nijel/weblate
    def pre_commit(self, translation, author):
        exporter = MoExporter(translation=translation)
        exporter.add_units(translation.unit_set.all())

        template = self.instance.configuration.get('path')
        if not template:
            template = '{{ filename|stripext }}.mo'

        output = self.render_repo_filename(template, translation)
        if not output:
            return

        with open(output, 'wb') as handle:
            handle.write(exporter.serialize())
        translation.addon_commit_files.append(output)