Java 小程序区域设置 [英] Java Applet Locale setting
问题描述
我正在运行英语版本的 WindowsXP,但已将西班牙语设置为我在 Firefox 中唯一接受的语言.我天真地希望在浏览器会话中加载小程序时将浏览器的语言设置为默认语言,但事实并非如此.小程序以英语启动,这是操作系统的默认语言.
I am running an english language version of WindowsXP, but have set Spanish as my only accepted language in Firefox. I had naively expected the browser's language to be set as the default when I load an applet in a browser session, but this does not appear to be the case. The applet starts up in English, the default language of the OS.
我可以添加一个新的 <param>到我的 Applet 并在初始化期间调用 Locale.setDefault(),但在我开始破解之前,我想知道我是否遗漏了一些明显的东西.浏览器或调用网页是否有通用机制可以设置<applet>的默认语言??
I could add a new <param> to my Applet and call Locale.setDefault() during initialization, but before I start hacking away I'd like to know if I'm missing something obvious. Is there a common mechanism by which the browser or invoking web page can set the default language of an <applet> ?
推荐答案
java 插件使用操作系统区域设置而不是浏览器区域设置.
The java plugin uses the OS locale not the browser one.
要覆盖默认区域设置,请进入 java 控制面板 - java 选项卡,按 Applet 运行时设置的查看按钮,并在第 4 列中添加所需的参数,即使它变灰也是可编辑的.
To override the default locale, go in the java control panel - java tab, Press the View button of the Applet Runtime Settings, and add the required parameter in the 4th column, it is editable even if it's grayed.
在你的情况下,试试 -Duser.language=es
In your case, try something like -Duser.language=es
再见.
这篇关于Java 小程序区域设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!