diff options
author | ng0 <ng0@taler.net> | 2019-12-14 16:46:19 +0000 |
---|---|---|
committer | ng0 <ng0@taler.net> | 2019-12-14 16:46:19 +0000 |
commit | 375496de12fc29466a438c0efef3be0decccb6cc (patch) | |
tree | a43cf5d33a90a4e00b7516e3969c7be88045d390 | |
parent | 3e26285cefa3a0c72d09203cc2a11ff9d5fb42a9 (diff) | |
download | www-375496de12fc29466a438c0efef3be0decccb6cc.tar.gz www-375496de12fc29466a438c0efef3be0decccb6cc.tar.bz2 www-375496de12fc29466a438c0efef3be0decccb6cc.zip |
remove toplevel i18nfix, exists in inc.
-rw-r--r-- | i18nfix.py | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/i18nfix.py b/i18nfix.py deleted file mode 100644 index 331706af..00000000 --- a/i18nfix.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python3 -# This file is in the public domain. - -""" -Extract translations from a Jinja2 template, stripping leading newlines. - -@author Florian Dold -""" - -import jinja2.ext -import re - -def normalize(message): - message = message.strip() - # collapse whitespaces (including newlines) into one space. - message = re.sub("\s+", " ", message) - return message - - -def babel_extract(fileobj, keywords, comment_tags, options): - res = jinja2.ext.babel_extract(fileobj, keywords, comment_tags, options) - for lineno, funcname, message, comments in res: - message = normalize(message) - yield lineno, funcname, message, comments - -def wrap_gettext(f): - """ - Call gettext with whitespace normalized. - """ - def wrapper(message): - message = normalize(message) - return f(message) - return wrapper |