XAML export formats numbers in the top-level TranslateTransform in the user's locale

Bug #1350897 reported by Johannes Rössel on 2014-07-31
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Medium
jazzynico

Bug Description

As a minimal example, the following SVG can be used:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="-1.5 1.5 10 10" height="5" width="5" version="1.1">
    </svg>

Which will result in the following XAML when exported on a system using a German locale:

    <?xml version="1.0" encoding="UTF-8"?>
    <Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Stretch="Uniform">
      <Canvas Name="svg3004" Width="10" Height="10">
        <Canvas.RenderTransform>
          <TranslateTransform X="1,5" Y="-1,5"/>
        </Canvas.RenderTransform>
        <Canvas.Resources/>
        <!--Unknown tag: metadata-->
        <!--Unknown tag: sodipodi:namedview-->
      </Canvas>
    </Viewbox>

Note the numbers being written as 1,5 in the top-level TranslateTransform. This appears to happen only for the TranslateTransform for the viewBox attribute, not if a transform attribute is used on any child element.

Switching to a US locale fixes the problem, but I still wonder why every single number is written correctly, but not those two.

Windows 8.1 x64, Inkscape 0.48.4 r

description: updated
su_v (suv-lp) on 2014-07-31
tags: added: exporting i18n xaml
jazzynico (jazzynico) wrote :

Related Bug #380199 "Exporting to XAML doesn't use culture independent decimal sign".
It seems that I forgot to apply the fix to the TranslateTransform element...

Changed in inkscape:
assignee: nobody → jazzynico (jazzynico)
importance: Undecided → Medium
milestone: none → 0.91
status: New → Triaged
status: Triaged → In Progress
jazzynico (jazzynico) wrote :

Patch in progress...

Ah, that was the meaning of those #.# parameters. I searched for quite a while why on earth only part of a stylesheet would be be locale-aware and couldn't find an answer. Things like xsl:decimal-format also didn't seem to change anything and the result even changed depending on who applied the XSLT.

(And I guess having a viewBox starting at non-zero is rare, but sometimes tools give you weird code on export.)

jazzynico (jazzynico) wrote :
jazzynico (jazzynico) wrote :

@Johannes - Would you be willing to test the attached patch and confirm it works for you? Thanks!

Looks good and works.

jazzynico (jazzynico) wrote :

Fixed in the trunk, revision 13488.

Thanks for your report and tests Johannes!

Changed in inkscape:
status: In Progress → Fix Committed
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers