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

Bug #1350897 reported by Johannes Rössel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
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

Revision history for this message
Johannes Rössel (joey-muhkuhsaft) wrote :
Revision history for this message
Johannes Rössel (joey-muhkuhsaft) wrote :
description: updated
su_v (suv-lp)
tags: added: exporting i18n xaml
Revision history for this message
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
Revision history for this message
jazzynico (jazzynico) wrote :

Patch in progress...

Revision history for this message
Johannes Rössel (joey-muhkuhsaft) wrote :

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.)

Revision history for this message
jazzynico (jazzynico) wrote :
Revision history for this message
jazzynico (jazzynico) wrote :

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

Revision history for this message
Johannes Rössel (joey-muhkuhsaft) wrote :

Looks good and works.

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.