0

This can be done with user32.dll on Windows. But how can i get it on Mac/Linux?

Dmitrii Sorin
  • 3,855
  • 4
  • 31
  • 40

1 Answers1

1

You should use nsILocaleService.getSystemLocale() for that:

var localeService = Components.classes["@mozilla.org/intl/nslocaleservice;1"]
                        .getService(Components.interfaces.nsILocaleService);
var sysLocale = localeService.getSystemLocale()
alert(sysLocale.getCategory("NSILOCALE_MESSAGES"));

This should work regardless of operating system.

Wladimir Palant
  • 56,865
  • 12
  • 98
  • 126