aboutsummaryrefslogtreecommitdiff
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.
10import jinja2.ext 10import jinja2.ext
11import re 11import re
12 12
13
13def normalize(message): 14def normalize(message):
14 message = message.strip() 15 message = message.strip()
15 # collapse whitespaces (including newlines) into one space. 16 # collapse whitespaces (including newlines) into one space.
@@ -23,6 +24,7 @@ def babel_extract(fileobj, keywords, comment_tags, options):
23 message = normalize(message) 24 message = normalize(message)
24 yield lineno, funcname, message, comments 25 yield lineno, funcname, message, comments
25 26
27
26def wrap_gettext(f): 28def wrap_gettext(f):
27 """ 29 """
28 Call gettext with whitespace normalized. 30 Call gettext with whitespace normalized.