diff options
author | Shaun McCance <shaunm@gnome.org> | 2011-06-23 16:11:42 -0400 |
---|---|---|
committer | Shaun McCance <shaunm@gnome.org> | 2011-06-23 16:11:42 -0400 |
commit | 4334f863ae6ab636b3e7c905e15693a188e4bee1 (patch) | |
tree | 21b6ff55aeedaafcb5a5726a03d2bc493d4f56d6 /tests | |
parent | 7ecd70b27d5cc22f8d6b35fc68aa9fe9cd3a7def (diff) | |
download | itstool-4334f863ae6ab636b3e7c905e15693a188e4bee1.tar.gz |
Handled translatable attributes in non-translatable elements
Diffstat (limited to 'tests')
-rw-r--r-- | tests/README | 4 | ||||
-rw-r--r-- | tests/run_tests.py | 3 | ||||
-rw-r--r-- | tests/x-attr1.ll.po | 19 | ||||
-rw-r--r-- | tests/x-attr1.ll.xml | 10 | ||||
-rw-r--r-- | tests/x-attr1.pot | 19 | ||||
-rw-r--r-- | tests/x-attr1.xml | 10 |
6 files changed, 64 insertions, 1 deletions
diff --git a/tests/README b/tests/README index 0556dfe..1d3d74a 100644 --- a/tests/README +++ b/tests/README @@ -1,5 +1,7 @@ To run the test suite, place yourself in the itstool root directory and run: $ python tests/run_tests.py -Test files are coming from: +Some test files are taken from the W3C: http://www.w3.org/International/its/tests/ + +Tests starting with x- are written specifically for itstool. diff --git a/tests/run_tests.py b/tests/run_tests.py index fe8727c..38bf025 100644 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -110,6 +110,9 @@ class ItstoolTests(unittest.TestCase): def test_withintext_linkedrules(self): self._test_translation_process('WithinText2.xml') + def test_attr1(self): + self._test_translation_process('x-attr1.xml') + class ITSTestRunner(unittest.TextTestRunner): def run(self, test): diff --git a/tests/x-attr1.ll.po b/tests/x-attr1.ll.po new file mode 100644 index 0000000..e7487b8 --- /dev/null +++ b/tests/x-attr1.ll.po @@ -0,0 +1,19 @@ +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2011-06-23 16:08-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: tests/x-attr1.xml:9(page/code@title) +msgid "one" +msgstr "eins" + +#: tests/x-attr1.xml:9(code/span@title) +msgid "two" +msgstr "zwei" + diff --git a/tests/x-attr1.ll.xml b/tests/x-attr1.ll.xml new file mode 100644 index 0000000..e256afc --- /dev/null +++ b/tests/x-attr1.ll.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<page> + <info> + <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0"> + <its:translateRule selector="//code" translate="no"/> + <its:translateRule selector="//@title" translate="yes"/> + </its:rules> + </info> + <code title="eins">Not translated <span title="zwei"/></code> +</page> diff --git a/tests/x-attr1.pot b/tests/x-attr1.pot new file mode 100644 index 0000000..f2eb0df --- /dev/null +++ b/tests/x-attr1.pot @@ -0,0 +1,19 @@ +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2011-06-23 16:08-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: tests/x-attr1.xml:9(page/code@title) +msgid "one" +msgstr "" + +#: tests/x-attr1.xml:9(code/span@title) +msgid "two" +msgstr "" + diff --git a/tests/x-attr1.xml b/tests/x-attr1.xml new file mode 100644 index 0000000..3233132 --- /dev/null +++ b/tests/x-attr1.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<page> + <info> + <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0"> + <its:translateRule selector="//code" translate="no"/> + <its:translateRule selector="//@title" translate="yes"/> + </its:rules> + </info> + <code title="one">Not translated <span title="two"/></code> +</page> |