summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Gedminas <marius@gedmin.as>2015-09-03 13:29:51 +0300
committerMarius Gedminas <marius@gedmin.as>2015-09-03 13:29:51 +0300
commit3e48d6c2df25101e9865921b4aff49aa7972b624 (patch)
tree3ca4574a8b0bf24d43852bcae4249650511da343
parent917323aa6d320ac2a305c6824e5d8a410bb1bed9 (diff)
parentc196b80feee936052acce68747342bcb81bf6083 (diff)
downloadzope-tal-3e48d6c2df25101e9865921b4aff49aa7972b624.tar.gz
Merge pull request #4 from gforcada/gforcada-patch-1
Add 'ignore' and 'ignore-attributes' to list of i18n valid attributes
-rw-r--r--CHANGES.rst3
-rw-r--r--src/zope/tal/taldefs.py2
-rw-r--r--src/zope/tal/tests/input/test38.html8
-rw-r--r--src/zope/tal/tests/output/test38.html6
4 files changed, 18 insertions, 1 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index cb86c9f..ad2284c 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,7 +4,8 @@ Changes
4.1.2 (unreleased)
------------------
-- TBD
+- Accept and ignore ``i18n:ignore`` and ``i18n:ignore-attributes`` attributes.
+ For compatibility with other tools (such as ``i18ndude``).
4.1.1 (2015-06-05)
------------------
diff --git a/src/zope/tal/taldefs.py b/src/zope/tal/taldefs.py
index 0715055..a4aaf61 100644
--- a/src/zope/tal/taldefs.py
+++ b/src/zope/tal/taldefs.py
@@ -61,6 +61,8 @@ KNOWN_I18N_ATTRIBUTES = frozenset([
"attributes",
"data",
"name",
+ "ignore",
+ "ignore-attributes",
])
class TALError(Exception):
diff --git a/src/zope/tal/tests/input/test38.html b/src/zope/tal/tests/input/test38.html
new file mode 100644
index 0000000..4bc3d1e
--- /dev/null
+++ b/src/zope/tal/tests/input/test38.html
@@ -0,0 +1,8 @@
+<span xmlns:i18n="http://xml.zope.org/namespaces/i18n">
+ <i18n:block ignore="">Test</i18n:block>
+ <a href="http://www.python.org"
+ title="Python"
+ i18n:ignore-attributes="title">
+ Python is a programming language.
+ </a>
+</span>
diff --git a/src/zope/tal/tests/output/test38.html b/src/zope/tal/tests/output/test38.html
new file mode 100644
index 0000000..8efb617
--- /dev/null
+++ b/src/zope/tal/tests/output/test38.html
@@ -0,0 +1,6 @@
+<span>
+ Test
+ <a href="http://www.python.org" title="Python">
+ Python is a programming language.
+ </a>
+</span>