What exactly does the `systemLanguage` attribute in multilingual SVG's refer to?

早过忘川 提交于 2019-12-10 10:16:57

问题


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:


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

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.



来源:https://stackoverflow.com/questions/31164086/what-exactly-does-the-systemlanguage-attribute-in-multilingual-svgs-refer-to

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!