Extensions: Multiline descriptions not translatable without xml:space="preserve"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
Fix Released
|
Low
|
Patrick Storz | ||
0.92.x |
Fix Released
|
Low
|
Patrick Storz |
Bug Description
(follow up for bug #980527)
If a description spans multiple lines, i.e.
<description>
I want to
use multiple lines
and whitespace
</description>
it is not properly translated by gettext.
The reason is, that gettext removes whitespace in such a case and the string "I want to use multiple lines and whitespace" ends up in the "inkscape.pot" file.
Now to prevent exactly this issue one can set the 'xml:space=
So far for the gettext side...
Inkscape is less picky. It *always* shows the text as if 'xml:space=
This behavior leaves us with two quirks:
- If an extension author does not specify 'xml:space=
- The 'xml:space=
Therefore I suggest two possible fixes:
1. The "proper" way to deal with this would be to make Inkscape actually respect the 'xml:space=
2. As this changes behavior it could change the appearance of some "description"s (obviously this would also be exactly those strings that are untranslatable right now). If this is something we really don't want one could solve it by keeping the behavior of Inkscape constant and simply implement a workaround for the gettext translation. This would effectively render the 'xml:space=
Personally I'd certainly prefer option 1. as it solves all ambiguities and makes the 'xml:space=
description: | updated |
Changed in inkscape: | |
assignee: | nobody → Eduard Braun (eduard-braun2) |
tags: | added: extensions |
Changed in inkscape: | |
importance: | Undecided → Low |
milestone: | none → 0.93 |
status: | In Progress → Fix Committed |
tags: |
added: extensions-plugins removed: extensions |
Changed in inkscape: | |
status: | Fix Committed → Fix Released |
Here's a patch addressing the translation issue.
With the patch applied "description"s should be properly translated regardless whether xml:space= "preserve" is specified or not.
Also it fixes/improves the following:
- Account for cases where the <param> node has multiple children (this can be the case if comments are included in the .inx file wich are interleaved with the text content but also if e.g. <br/> tags are used). Inkscape will now concatenate all (text-only) children of the <param> node.
- Allow <br/> to be used to produce a line break in descriptions.