Page MenuHomePhabricator

SVG Translate offers to translate phrases that are already restricted by `systemLanguage`
Closed, DuplicatePublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

What happens?:
Tool displays 8 phrases to translate. The phrases are in different languages, and they are descendants of a switch element or another element that has already selected a language.

The given file uses a planar translation: a`switch` element selects a group (g) that has text descendants.

<switch>
  <g systemLanguage="de">
    <text>A</text>
    <text>B</text>
  </g>
  <g systemLanguage="en">
    <text>C</text>
    <text>D</text>
  </g>
  <g systemLanguage="fr">
    <text>E</text>
    <text>F</text>
  </g>
  <g systemLanguage="ro">
    <text>G</text>
    <text>H</text>
  </g>
</switch>

That is not the organization that SVG Translate expects. SVG Translate expects the children of a switch element will be text elements.

SVG Translate apparently offers every text element for translation (i.e., A, B, C, D, E, F, G, and H). It does not recognize the effect of the switch ancestor or any element with systemLanguage attribute.

What should have happened instead?:

SVG Translate should have declined to offer any translations. Starting from the text element, it should have climbed the hierarchy, discovered an element with a systemLanguage attribute (showing that a language has been selected) (or a switch element), and then declined to translate the text element.

See also