[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[OpenTAL-checkins] opental/OpenPTi18n i18n_handler.py
From: |
Fernando Lalo Martins |
Subject: |
[OpenTAL-checkins] opental/OpenPTi18n i18n_handler.py |
Date: |
Fri, 28 Mar 2003 14:57:42 -0500 |
CVSROOT: /cvsroot/opental
Module name: opental
Changes by: Fernando Lalo Martins <address@hidden> 03/03/28 14:57:42
Modified files:
OpenPTi18n : i18n_handler.py
Log message:
new syntax for i18n:attributes (for giving explicit ids)
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/opental/opental/OpenPTi18n/i18n_handler.py.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
Patches:
Index: opental/OpenPTi18n/i18n_handler.py
diff -u opental/OpenPTi18n/i18n_handler.py:1.21
opental/OpenPTi18n/i18n_handler.py:1.22
--- opental/OpenPTi18n/i18n_handler.py:1.21 Wed Jan 29 17:29:59 2003
+++ opental/OpenPTi18n/i18n_handler.py Fri Mar 28 14:57:42 2003
@@ -103,9 +103,19 @@
element = result
if info.has_key('attributes') and hasattr(element, 'attributes'):
attrs = element.attributes.setdefault(element.ns, {})
- for name in info['attributes'].split():
- msgid = attrs[name]
- attrs[name] = context.translate(domain, msgid, None, request,
target, msgid)
+ for name in info['attributes'].split(';'):
+ attr = name.strip().split()
+ if len(attr) == 1:
+ msgid = attrs[name]
+ elif len(attr) == 2:
+ name, msgid = attr
+ else: # old-style
+ for name in attr:
+ msgid = attrs[name]
+ attrs[name] = context.translate(domain, msgid, None,
request, target, msgid)
+ msgid = name = None
+ if msgid is not None:
+ attrs[name] = context.translate(domain, msgid, None,
request, target, msgid)
if info.has_key('name'):
name = info['name']
element = context.tr_engine.postprocess(element, context)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [OpenTAL-checkins] opental/OpenPTi18n i18n_handler.py,
Fernando Lalo Martins <=