summaryrefslogtreecommitdiff
path: root/i18nfix.py
diff options
context:
space:
mode:
Diffstat (limited to 'i18nfix.py')
-rw-r--r--i18nfix.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/i18nfix.py b/i18nfix.py
index 331706af..b7fb4561 100644
--- a/i18nfix.py
+++ b/i18nfix.py
@@ -10,6 +10,7 @@ Extract translations from a Jinja2 template, stripping leading newlines.
import jinja2.ext
import re
+
def normalize(message):
message = message.strip()
# collapse whitespaces (including newlines) into one space.
@@ -23,6 +24,7 @@ def babel_extract(fileobj, keywords, comment_tags, options):
message = normalize(message)
yield lineno, funcname, message, comments
+
def wrap_gettext(f):
"""
Call gettext with whitespace normalized.