Ticket #404 (closed defect: fixed)
i18n:msg removes some text under certain conditions
| Reported by: | Martin Scharrer <martin@…> | Owned by: | cmlenz |
|---|---|---|---|
| Priority: | critical | Milestone: | 0.7 |
| Component: | Template processing | Version: | 0.6 |
| Keywords: | i18n:msg text removed | Cc: | hoff.st@… |
Description
I found the following behavior when I was working on th:WatchlistPlugin and had a closer look on it.
When using the i18n:msg attribute then under certain conditions parts of the text content is missing in the final rendered XML output.
The conditions seem to be:
- i18n:msg argument with two variables, like i18n:msg="first,second"
- The first argument IS NOT inside a tag
- The second argument IS inside a tag
- After both arguments there is the following content:
- A text NOT inside a tag
- A text INSIDE a tag
- A text NOT inside a tag
Then the text 4a is REMOVED from the rendered XML/XHTML output.
Example:
<p class="incorrect" i18n:msg="first,second">
$first <span>$second</span> REMOVED <span>Inside a tag</span> Outside a tag
</p>
results in (with first='FIRST', second='SECOND'):
<p class="incorrect">FIRST <span>SECOND</span><span>Inside a tag</span> Outside a tag</p>
If e.g. the first argument is also inside a tag the rendered output is correct. Also when the i18n:msg argument is dropped it works correctly.
I wrote a demonstration script and attached it together with the output I get. It shows several slightly different variations to demonstrate the above conditions.
Note: This was tested with Genshi 0.6 stable and 0.7dev-r1134 and Babel 0.9.5.


