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)
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)
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)