What exactly does the `systemLanguage` attribute i

2019-05-10 10:19发布

The SVG specs describe a systemLanguage attribute (http://www.w3.org/TR/SVG/struct.html#SystemLanguageAttribute) that can be used to provide multilingual content (for example when put in a switch that provides cases for different languages).

But what exactly is meant with systemLanguage? Is it the language of the Browser? The language of operating System? The keyboard layout language? The thing that PHP's $_SERVER[’HTTP_ACCEPT_LANGUAGE’] contains? A parameter of the SVG file itself (like foo.svg?en-US)? What "thing" can/should/may I change to actually trigger the element with matching systemLanguage attribute?

Background: I'm about to design a website that has a language switcher. This website will contain SVG images. And the SVG images will contain text. That's why I wonder about what the systemLanguage attribute evaluates exactly. Can I pass the language that is selected by the user of my website to the SVG file or does it only work if the user actually changes some Browser/OS language?

Edit: Just found, on Wikimedia Commons there is an example, where one can actually change the language with a drop down box: https://commons.wikimedia.org/wiki/File:SystemLanguage.svg, but I can't figure out how the language is passed to the SVG file.

1条回答
干净又极端
2楼-- · 2019-05-10 10:55

In Firefox it matches your preferred language or languages set via about:preferences#content then click on the Choose... button

Language selection dialogue

Chrome has a similar mechanism as do other UAs.

Mediawiki are are displaying a png on that page, they display a different png if you select a different language in the dropdown. If you click on the png you go to a page with an actual svg file that you can change by changing your UA language.

查看更多
登录 后发表回答