84106

Java Applet Locale setting

Question:

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

Answer1:

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.

Answer2:

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

Recommend

  • Scraping flash using HtmlUnit or other java tool
  • how to get MAC address using any browser with javascript [duplicate]
  • What cross-browser technology do you use in your web applications to manipulate on client machines?
  • How to change display text in item template based on eval in gridview?
  • Selection Sort, For Java
  • Custom locale in Android
  • iOS 6 dateFromString returns wrong date
  • CFBundleDevelopmentRegion not works as expected
  • HttpServletRequest getLocale returns OS locale not browser locale
  • Less Conflicting Session Manager for Zope 2
  • Doctrine2 bulk import try to work with another entity
  • Passing “get” parameters doesn't work, parameter not visible in the link
  • JPA flush vs commit
  • Does Mobilefirst provide a provision to access web services directly?
  • Android activity accessing service's static reference before the service is ready
  • Declaring variable dynamically in VB.net
  • How to get address from latitude and longitude android google map v2 [duplicate]
  • Installing Hadoop, Java Exception about illegal characters at index 7?
  • Different response to non-authenticated users and AJAX calls
  • Submit form in a displaytag pagination
  • Apache 2.4 - remove | delete | uninstall
  • Cannot Parse HTML Data Using Android / JSOUP
  • How do you join a server to an Active Directory (domain)?
  • JTable with a ScrollPane misbehaving
  • Angular 2 constructor injection vs direct access
  • Understanding cpu registers
  • Java static initializers and reflection
  • Change div Background jquery
  • Android Google Maps API OnLocationChanged only called once
  • How does Linux kernel interrupt the application?
  • How to get Windows thread pool to call class member function?
  • IndexOutOfRangeException on multidimensional array despite using GetLength check
  • Busy indicator not showing up in wpf window [duplicate]
  • costura.fody for a dll that references another dll
  • Observable and ngFor in Angular 2
  • How to Embed XSL into XML
  • UserPrincipal.Current returns apppool on IIS
  • Conditional In-Line CSS for IE and Others?
  • Why do underscore prefixed variables exist?
  • java string with new operator and a literal