summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorshimizukawa <shimizukawa@gmail.com>2013-10-04 05:07:09 +0900
committershimizukawa <shimizukawa@gmail.com>2013-10-04 05:07:09 +0900
commitc3e34e0e59f9f1e16a7eed958685c854c666b96e (patch)
tree0c0e2d2a71ef4854b60deb4113cbb78f41243af0 /tests
parentc0ec30bb423782d83b55e7cd1590fb20d396901a (diff)
downloadsphinx-c3e34e0e59f9f1e16a7eed958685c854c666b96e.tar.gz
Now gettext translates label target name. Fix i18n: crash when using a indirect target and translating a target section name. Closes #1265
Diffstat (limited to 'tests')
-rw-r--r--tests/roots/test-intl/label_target.po21
-rw-r--r--tests/roots/test-intl/label_target.txt4
-rw-r--r--tests/test_intl.py15
3 files changed, 23 insertions, 17 deletions
diff --git a/tests/roots/test-intl/label_target.po b/tests/roots/test-intl/label_target.po
index 60d7c3e5..7255dd98 100644
--- a/tests/roots/test-intl/label_target.po
+++ b/tests/roots/test-intl/label_target.po
@@ -31,10 +31,10 @@ msgstr "X EXPLICIT-TARGET"
msgid ""
":ref:`explicit-target` point to ``explicit-target`` and `explicit-target`_"
-" point to duplicated id like ``id1``."
+" point to ``explicit-target`` too."
msgstr ""
":ref:`explicit-target` POINT TO ``explicit-target`` AND `X EXPLICIT-TARGET`_"
-" POINT TO DUPLICATED ID LIKE ``id1``."
+" POINT TO ``explicit-target`` TOO."
msgid "implicit section name"
msgstr "X IMPLICIT SECTION NAME"
@@ -53,14 +53,21 @@ msgstr ""
msgid "label bridged target section"
msgstr "X LABEL BRIDGED TARGET SECTION"
-msgid "`bridge label`_ is not translatable but linked to translated section title."
-msgstr "X `bridge label`_ IS NOT TRANSLATABLE BUT LINKED TO TRANSLATED SECTION TITLE."
+msgid "`bridge label`_ is also translatable and linked to translated section title."
+msgstr "X `Y BRIDGE LABEL`_ IS ALSO TRANSLATABLE AND LINKED TO TRANSLATED SECTION TITLE."
msgid ""
"`bridge label2`_ point to ``section and label`` and `bridge label`_ point to "
"``label bridged target section``. The second appeared `bridge label2`_ point "
"to correct target."
msgstr ""
-"X `bridge label`_ POINT TO ``LABEL BRIDGED TARGET SECTION`` AND "
-"`bridge label2`_ POINT TO ``SECTION AND LABEL``. THE SECOND APPEARED "
-"`bridge label2`_ POINT TO CORRECT TARGET."
+"X `Y BRIDGE LABEL`_ POINT TO ``LABEL BRIDGED TARGET SECTION`` AND "
+"`Z BRIDGE LABEL2`_ POINT TO ``SECTION AND LABEL``. THE SECOND APPEARED "
+"`Z BRIDGE LABEL2`_ POINT TO CORRECT TARGET."
+
+msgid "bridge label"
+msgstr "Y BRIDGE LABEL"
+
+msgid "bridge label2"
+msgstr "Z BRIDGE LABEL2"
+
diff --git a/tests/roots/test-intl/label_target.txt b/tests/roots/test-intl/label_target.txt
index ac000849..93378d36 100644
--- a/tests/roots/test-intl/label_target.txt
+++ b/tests/roots/test-intl/label_target.txt
@@ -21,7 +21,7 @@ explicit-target
.. This case, a duplicated target id is generated by docutils.
:ref:`explicit-target` point to ``explicit-target`` and
-`explicit-target`_ point to duplicated id like ``id1``.
+`explicit-target`_ point to ``explicit-target`` too.
implicit section name
@@ -61,7 +61,7 @@ label bridged target section
.. This section is targeted through label definition.
-`bridge label`_ is not translatable but linked to translated section title.
+`bridge label`_ is also translatable and linked to translated section title.
`bridge label2`_ point to ``section and label`` and `bridge label`_ point to ``label bridged target section``. The second appeared `bridge label2`_ point to correct target.
diff --git a/tests/test_intl.py b/tests/test_intl.py
index 744e1679..1fb2ae1d 100644
--- a/tests/test_intl.py
+++ b/tests/test_intl.py
@@ -436,9 +436,8 @@ def test_i18n_label_target(app):
assert_elem(
para1[0],
texts=['X EXPLICIT-TARGET', 'POINT TO', 'explicit-target', 'AND',
- 'X EXPLICIT-TARGET', 'POINT TO DUPLICATED ID LIKE', 'id1',
- '.'],
- refs=['explicit-target', 'id1'])
+ 'X EXPLICIT-TARGET', 'POINT TO', 'explicit-target', 'TOO.'],
+ refs=['explicit-target', 'explicit-target'])
para2 = secs[2].findall('paragraph')
assert_elem(
@@ -458,16 +457,16 @@ def test_i18n_label_target(app):
para3 = secs[3].findall('paragraph')
assert_elem(
para3[0],
- texts=['X', 'bridge label',
- 'IS NOT TRANSLATABLE BUT LINKED TO TRANSLATED ' +
+ texts=['X', 'Y BRIDGE LABEL',
+ 'IS ALSO TRANSLATABLE AND LINKED TO TRANSLATED ' +
'SECTION TITLE.'],
refs=['label-bridged-target-section'])
assert_elem(
para3[1],
- texts=['X', 'bridge label', 'POINT TO',
- 'LABEL BRIDGED TARGET SECTION', 'AND', 'bridge label2',
+ texts=['X', 'Y BRIDGE LABEL', 'POINT TO',
+ 'LABEL BRIDGED TARGET SECTION', 'AND', 'Z BRIDGE LABEL2',
'POINT TO', 'SECTION AND LABEL', '. THE SECOND APPEARED',
- 'bridge label2', 'POINT TO CORRECT TARGET.'],
+ 'Z BRIDGE LABEL2', 'POINT TO CORRECT TARGET.'],
refs=['label-bridged-target-section',
'section-and-label',
'section-and-label'])