GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still and

Commit 1e20c72f authored by Peter Palfrader's avatar Peter Palfrader
Browse files

lektor_i18n: merge tempfile fix from

parent 842b8e92
......@@ -426,10 +426,18 @@ class I18NPlugin(Plugin):
self.process_node(fields, sections, source,, builder.env.root_path)
def get_templates_pot_filename(self):
return self.pot_templates_filename
except AttributeError:
self.pot_templates_file = tempfile.NamedTemporaryFile(suffix=".pot",prefix="templates-")
self.pot_templates_filename =
return self.pot_templates_filename
def on_before_build_all(self, builder, **extra):
if self.enabled:
reporter.report_generic("i18n activated, with main language %s"% self.content_language )
templates_pot_filename = join(tempfile.gettempdir(), 'templates.pot')
templates_pot_filename = self.get_templates_pot_filename()
reporter.report_generic("Parsing templates for i18n into %s" \
% relpath(templates_pot_filename, builder.env.root_path))
......@@ -443,7 +451,7 @@ class I18NPlugin(Plugin):
contents_pot_filename = join(builder.env.root_path, self.i18npath, 'contents.pot')
pots = [contents_pot_filename,
join(tempfile.gettempdir(), 'templates.pot'),
join(builder.env.root_path, self.i18npath, 'plugins.pot')]
# write out contents.pot from web site contents
translations.write_pot(pots[0], self.content_language)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment