This can be done with user32.dll on Windows. But how can i get it on Mac/Linux?
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.