Page MenuHomePhabricator

Allow to translate text in a <tspan> element
Closed, DuplicatePublic


What is the problem?

I tried to translate the city names in to English but it didn't let me. Looking at the SVG source it looks like this:

   style="font-size:91.67308044px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Times New Roman;-inkscape-font-specification:Times New Roman"
     style="font-size:122.2307663px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:DejaVu Sans;-inkscape-font-specification:DejaVu Sans"
     y="2815.1726">European Vertical </tspan><tspan
     style="font-size:122.2307663px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:DejaVu Sans;-inkscape-font-specification:DejaVu Sans"
     id="tspan4231">Reference System (EVRS)</tspan></text>
Steps to reproduce problem
  1. Go to
  2. type in Vertical_references_in_Europe.svg

Expected behavior: tool lets me translate the text because it's in a <text><tspan> element
Observed behavior: tool doesn't let me translate the file

Event Timeline

Aklapper renamed this task from [REQUEST] let me translate text in a <tspan> element to Allow to translate text in a <tspan> element.Apr 20 2021, 5:49 AM

The text element in the description looks acceptable: one text with single-level tspan elements and no #text.

Confirm that SVG Translate did not offer any translations.

The file had an empty text element in it. I removed that element.

Still fails.

The style elements have a * selector. Perhaps the CSS regex does not expect that?

Put fill="none" in svg element. Remove two CSS * {fill:none;} from style elements.

Still fails, but perhaps the SVG Translate cache has not emptied.

Ach! There is a third style element with a * selector. Removed it.

Still fails. Last test at 2:13 PM. Will wait and try again later.

Looked at third style block more closely. Do not see space issue (T271595). But it has CSS ID selectors!

/* Default Definitions, can be overridden with the individual style selectors */
g.nationGroup path {fill:inherit;stroke:inherit}
g.nationGroup, path        { fill:#C0C0C0; stroke:white; stroke-width:8; } 
      /* stroke-width was originally at around 4px, but this makes it difficult to see when the image is smaller */
/* Geographic Features */
#ocean {opacity:1;fill:none;fill-opacity:1}
#lakes {opacity:0.4;fill:white;fill-opacity:1;stroke:none;stroke-width:8}


Therefore, I expect this issue is a duplicate of T221382.

replaced CSS ID selectors with class selectors of IDENTocean and IDENTlakes.

Removed many empty CSS ID selectors in another style element.

SVG Translate now offers translations.

Direct link for SVG Translate: