DGentry
DGentry

Reputation: 16248

Java Applet Locale setting

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.

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> ?

Upvotes: 0

Views: 4069

Answers (2)

Aron Olsen
Aron Olsen

Reputation: 1

Previously, the default locale for applets and for Java-applications was derived from the locale of Windows. With jre 7 this is still true for Java-applications, but it is no longer true for applets. The default locale for applets is en_US no matter how you set the Windows locale. This must truely be a bug related to the Java plugin. /Aron

Upvotes: 0

RealHowTo
RealHowTo

Reputation: 35372

The java plugin uses the OS locale not the browser one.

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.

In your case, try something like -Duser.language=es

Bye.

Upvotes: 2

Related Questions