summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2011-06-25 14:49:53 -0400
committerShaun McCance <shaunm@gnome.org>2011-06-25 14:49:53 -0400
commit8d97758ac43f2079d252fedf2a9666b33a751fd0 (patch)
tree6a5926ddcaf575c9bb7f5792ecbfb4a548b57c28 /tests
parente84f296dd21de75b9244896be9d2acc6aeed4dea (diff)
downloaditstool-8d97758ac43f2079d252fedf2a9666b33a751fd0.tar.gz
Added itst:context to specify a msgctxt for a node
Diffstat (limited to 'tests')
-rw-r--r--tests/Context.ll.po35
-rw-r--r--tests/Context.ll.xml15
-rw-r--r--tests/Context.pot35
-rw-r--r--tests/Context.xml14
-rw-r--r--tests/run_tests.py3
5 files changed, 102 insertions, 0 deletions
diff --git a/tests/Context.ll.po b/tests/Context.ll.po
new file mode 100644
index 0000000..6ea88ff
--- /dev/null
+++ b/tests/Context.ll.po
@@ -0,0 +1,35 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2011-06-25 14:23-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/Context.xml:8(info/title)
+msgctxt "[[sort]]"
+msgid "Title"
+msgstr "Sort"
+
+#: tests/Context.xml:9(info/title)
+msgctxt "link"
+msgid "Link title"
+msgstr "Linky"
+
+#: tests/Context.xml:10(info/title)
+msgctxt "link:topic"
+msgid "Topic link title"
+msgstr "Topics"
+
+#: tests/Context.xml:12(page/title)
+msgid "Title"
+msgstr "Main title"
+
+#: tests/Context.xml:13(page/p)
+msgctxt "paragraph"
+msgid "Context is paragraph"
+msgstr "This is a paragraph"
+
diff --git a/tests/Context.ll.xml b/tests/Context.ll.xml
new file mode 100644
index 0000000..16e122c
--- /dev/null
+++ b/tests/Context.ll.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<page xmlns:its="http://www.w3.org/2005/11/its" xmlns:itst="http://itstool.org/extensions/" its:version="1.0">
+ <info>
+ <its:rules version="1.0">
+ <itst:contextRule selector="//title[@type]" contextPointer="@type"/>
+ <itst:contextRule selector="//title[@type = 'sort']" context="[[sort]]"/>
+ <itst:contextRule selector="//title[@type and @role]" contextPointer="concat(@type, ':', @role)"/>
+ </its:rules>
+ <title type="sort">Sort</title>
+ <title type="link">Linky</title>
+ <title type="link" role="topic">Topics</title>
+ </info>
+ <title>Main title</title>
+ <p itst:context="paragraph">This is a paragraph</p>
+</page>
diff --git a/tests/Context.pot b/tests/Context.pot
new file mode 100644
index 0000000..26e078c
--- /dev/null
+++ b/tests/Context.pot
@@ -0,0 +1,35 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2011-06-25 14:23-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/Context.xml:8(info/title)
+msgctxt "[[sort]]"
+msgid "Title"
+msgstr ""
+
+#: tests/Context.xml:9(info/title)
+msgctxt "link"
+msgid "Link title"
+msgstr ""
+
+#: tests/Context.xml:10(info/title)
+msgctxt "link:topic"
+msgid "Topic link title"
+msgstr ""
+
+#: tests/Context.xml:12(page/title)
+msgid "Title"
+msgstr ""
+
+#: tests/Context.xml:13(page/p)
+msgctxt "paragraph"
+msgid "Context is paragraph"
+msgstr ""
+
diff --git a/tests/Context.xml b/tests/Context.xml
new file mode 100644
index 0000000..390ebc8
--- /dev/null
+++ b/tests/Context.xml
@@ -0,0 +1,14 @@
+<page xmlns:its="http://www.w3.org/2005/11/its" xmlns:itst="http://itstool.org/extensions/" its:version="1.0">
+ <info>
+ <its:rules version="1.0">
+ <itst:contextRule selector="//title[@type]" contextPointer="@type"/>
+ <itst:contextRule selector="//title[@type = 'sort']" context="[[sort]]"/>
+ <itst:contextRule selector="//title[@type and @role]" contextPointer="concat(@type, ':', @role)"/>
+ </its:rules>
+ <title type="sort">Title</title>
+ <title type="link">Link title</title>
+ <title type="link" role="topic">Topic link title</title>
+ </info>
+ <title>Title</title>
+ <p itst:context="paragraph">Context is paragraph</p>
+</page>
diff --git a/tests/run_tests.py b/tests/run_tests.py
index 21c594f..e8b009e 100644
--- a/tests/run_tests.py
+++ b/tests/run_tests.py
@@ -117,6 +117,9 @@ class ItstoolTests(unittest.TestCase):
def test_attributes1(self):
self._test_translation_process('Attributes1.xml')
+ def test_context(self):
+ self._test_translation_process('Context.xml')
+
class ITSTestRunner(unittest.TextTestRunner):
def run(self, test):