Page MenuHomePhabricator

Multilanguage SVG images should be rendered in the wiki's content language
Open, MediumPublic

Description

See https://de.wikipedia.org/wiki/Benutzer:Rezonansowy/Sandbox . This image should display in German, not in my useragent lang (English).


Version: 1.23.0
Severity: enhancement
URL: https://de.wikipedia.org/w/index.php?title=Benutzer:Rezonansowy/Sandbox&oldid=127767323

Details

Reference
bz61649

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:54 AM
bzimport set Reference to bz61649.
bzimport added a subscriber: Unknown Object (MLST).

I don't think it follows anything at the moment, just takes the first language from the SVG. You can override with [[File:Multilingual_SVG_example.svg|lang=de]].

(Btw note that this image does not have fallback text so it would not display any text at all if your language does not happen to be one of en, de, es, fr.)

(In reply to Tisza Gergő from comment #1)

I don't think it follows anything at the moment, just takes the first
language from the SVG. You can override with
[[File:Multilingual_SVG_example.svg|lang=de]].

(Btw note that this image does not have fallback text so it would not
display any text at all if your language does not happen to be one of en,
de, es, fr.)

No, its hardcoded en (i think this bug might be a dupe of something)

I generally agree in principle that it should use content lang by default. I would be ok with possibly using userlang on sites like commons that are multilingual, but it would have to be evaluated carefully if that would cause confusion

FYI: I have written svg-sieve a script that does what bug 4688 suggests, select which layers to display, and by extension, bug 16052, select messages in a particular language. See bug 4688.

Bug 58920 points out that the browser implementation of the "lang" option is inconsistent. In theory, embedding an SVG in a page with the "lang" attribute set at top-level would result in the behavior you want. In practice, the browser uses the user-specific preferred language --- so, as bawolff points out in comment 2, the first thing we should decide is which of these semantics we want. Should we use the wiki language or the browser's language?

  • Bug 66041 has been marked as a duplicate of this bug. ***

(In reply to C. Scott Ananian from comment #4)

Bug 58920 points out that the browser implementation of the "lang" option is
inconsistent. In theory, embedding an SVG in a page with the "lang"
attribute set at top-level would result in the behavior you want. In
practice, the browser uses the user-specific preferred language --- so, as
bawolff points out in comment 2, the first thing we should decide is which
of these semantics we want. Should we use the wiki language or the
browser's language?

Definitely the wiki language, to keep the consistency with the rest of the page content.

Another annoying point is you can't set at minimum a fallback or default language. It is always English (if present) so I still can't prefer SVG lang switch.