2

I have an xulrunner app which has Japanese and English locales. Using -UILocale <locale> to switch locales works fine, so there's no problem with the actual locale files or code, but running the app on Japanese computers, it still comes up in English. Apparently "normally the application locale is inherited from the OS environment of the host system", but that doesn't seem to be happening on Windows or OS X.

I have added the default pref("intl.locale.matchOS", "true") just to be sure, but still no dice. I've also tried pretty much every version of xulrunner.

How is xulrunner supposed to detect the system locale, and how can I make it do so?

Simon Cozens
  • 755
  • 4
  • 16

1 Answers1

-1

Please refer this

https://developer.mozilla.org/en-US/docs/Make_your_xulrunner_app_match_the_system_locale

from xpcom import components
ps_cls = components.classes["@mozilla.org/preferences-service;1"]
ps = ps_cls.getService(components.interfaces.nsIPrefService)
branch = ps.getBranch("general.useragent.")
branch.setCharPref("locale", lang)

os.environ["LANGUAGE"] = lang

set lang as per locale.

Sandip
  • 981
  • 1
  • 6
  • 22
  • The documentation (which of course I have read) isn't useful since it assumes that I'm using Python, which I'm not. (Nor are most users of XUL.) – Simon Cozens Jul 03 '13 at 01:06