Extensions: Multiline descriptions not translatable without xml:space="preserve"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Inkscape |
Low
|
Patrick Storz | ||
| 0.92.x |
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 |
Patrick Storz (ede123) wrote : | #2 |
Pushed to trunk in
http://
I suggest to also apply to 0.92.x branch to achieve consistent behavior in the stable branch and trunk. It slightly changes behavior but I guess the gain outweighs potential compatibility concerns, especially as it only affects the specific cases that resulted in untranslatable content before.
Changed in inkscape: | |
importance: | Undecided → Low |
milestone: | none → 0.93 |
status: | In Progress → Fix Committed |
Patrick Storz (ede123) wrote : | #3 |
I went ahead and pushed to 0.92.x
http://
Please test and let me know if you encounter any issues, so we can fix them in time for the release.
chr[] (chr0x07) wrote : | #4 |
Hi
That change causes translation bugs, see screenshot (export to hpgl)
Some inx files uses this dummy:
<param name="space" type="descripti
and I am puzzled. Why is this translated?
<_param>should be translated</_param>
<param>but this not, no?</param>
Patrick Storz (ede123) wrote : | #5 |
Not a regression but actually a bug that went unnoticed so far!
The changes here only made the issue visible as " " (non-breaking space) is now properly treated as unnecessary whitespace and therefore removed if 'xml:space=
Fixed in
http://
Descriptions are now only translated if the underscored version (<_param>) is used.
Patrick Storz (ede123) wrote : | #6 |
Also committed in
http://
Please feel free to thoroughly test those changes in case there are any other issues that went unnoticed so far.
chr[] (chr0x07) wrote : | #7 |
Hi
I tested trunk and 0.92:
translation bugs gone,
<br/> works
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.