summaryrefslogtreecommitdiff
path: root/django/bin
diff options
context:
space:
mode:
authorGeorg Bauer <gb@hugo.westfalen.de>2005-10-01 16:47:15 +0000
committerGeorg Bauer <gb@hugo.westfalen.de>2005-10-01 16:47:15 +0000
commit0649365f43fb71332e3f492f635dc8daa7b0bc8a (patch)
tree2fbcdb067d2d07bdbbd9b1a40f8291a5b1cc0438 /django/bin
parentbd9cb4c9f45ab6b26359cacc2dc6a44ec58f21ff (diff)
i18n: changed all admin templates to use the new shorter {{ _(..) }} syntax for i18n strings.
git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@763 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/bin')
-rwxr-xr-xdjango/bin/make-messages.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/django/bin/make-messages.py b/django/bin/make-messages.py
index d445335915..a97297c08b 100755
--- a/django/bin/make-messages.py
+++ b/django/bin/make-messages.py
@@ -39,7 +39,9 @@ if not os.path.isdir(basedir):
lf = os.path.join(basedir, '%s.po' % domain)
-tpl_re = re.compile(r'{%\s+i18n\s+.*?%}')
+tpl_i18n_re = re.compile(r'{%\s+i18n\s+.*?%}')
+tpl_value_re = re.compile(r'{{\s*_\(.*?\)\s*}}')
+tpl_tag_re = re.compile(r"""{%.*_\((?:".*?")|(?:'.*?')\).*%}""")
for (dirpath, dirnames, filenames) in os.walk("."):
for file in filenames:
@@ -48,7 +50,11 @@ for (dirpath, dirnames, filenames) in os.walk("."):
if file.endswith('.html'):
src = open(os.path.join(dirpath, file), "rb").read()
lst = []
- for match in tpl_re.findall(src):
+ for match in tpl_i18n_re.findall(src):
+ lst.append(match)
+ for match in tpl_value_re.findall(src):
+ lst.append(match)
+ for match in tpl_tag_re.findall(src):
lst.append(match)
open(os.path.join(dirpath, '%s.py' % file), "wb").write('\n'.join(lst))
thefile = '%s.py' % file