问题描述
SVG规范描述了systemLanguage
属性( http://www. w3.org/TR/SVG/struct.html#SystemLanguageAttribute ),可用于提供多语言内容(例如,放在switch
中以提供不同语言的情况时).
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).
但是systemLanguage
到底是什么意思?它是浏览器的语言吗?操作系统的语言?键盘布局语言? PHP的$_SERVER[’HTTP_ACCEPT_LANGUAGE’]
包含的内容? SVG文件本身的参数(如foo.svg?en-US
)?我可以/应该/应该更改什么内容"以实际触发具有匹配的systemLanguage
属性的元素?
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?
背景:我将要设计一个具有语言切换器的网站.该网站将包含SVG图片. SVG图像将包含文本.这就是为什么我想知道systemLanguage
属性的准确评估结果的原因.我可以将网站用户选择的语言传递给SVG文件,还是仅在用户实际更改了某种浏览器/操作系统语言后才能使用?
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?
刚刚发现,在Wikimedia Commons上有一个示例,其中实际上可以使用下拉框更改语言: https://commons.wikimedia.org/wiki/File:SystemLanguage.svg ,但我不知道该语言是如何传递到SVG文件的.
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.
推荐答案
在Firefox中,它与您喜欢的一种或多种通过about:preferences#content
设置的语言匹配,然后单击选择..."按钮
In Firefox it matches your preferred language or languages set via about:preferences#content
then click on the Choose... button
Chrome具有与其他UA相似的机制.
Chrome has a similar mechanism as do other UAs.
Mediawiki在该页面上显示png,如果您在下拉菜单中选择其他语言,则它们将显示不同的png.如果单击png,则会转到包含实际svg文件的页面,可以通过更改UA语言来更改该文件.
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.
这篇关于多语言SVG中的`systemLanguage`属性到底指的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!