intl/locale/tests/nsLocaleTest.html
author Serge Gautherie <sgautherie.bz@free.fr>
Fri, 07 Aug 2009 01:43:53 +0200
changeset 31200 9281246909f0227f281b357f21b248d2ae62a9d2
parent 1 9b2a99adc05e53cd4010de512f50118594756650
permissions -rw-r--r--
Bug 450450 - mochitest-plain: test_loadflags.html intermittently fails; (Bv1a) Make it more serial, explicit and documented; r=dwitte

<html>
<head>
    <title>nsLocale Scriptability Test</title>

</head>

<script>

var localeService = null;
var applicationLocale = null;
var systemLocale = null;

function get_locale_service() {
      localeService = Components.classes["@mozilla.org/intl/nslocaleservice;1"].createInstance();
      localeService = localeService.QueryInterface(Components.interfaces.nsILocaleService);
      applicationLocale = localeService.GetApplicationLocale();
      systemLocale = localeService.GetSystemLocale();
}

function do_application_locale(t) {
      t.value = applicationLocale.GetCategory("NSILOCALE_MESSAGES");
}

function do_system_locale(t) {
      t.value = systemLocale.GetCategory("NSILOCALE_MESSAGES");
}

</script>

<body BGCOLOR="#FFFFFF" TEXT="#000000" onLoad="get_locale_service();">

<form name="locale">
<b>Application Locale: </b>
<input type="button" value="Get Application Locale" onClick=do_application_locale(this);></br>
<b>System Locale: </b>
<input type="button" value="Get System Locale" onClick=do_system_locale(this);></br>
</form>

<hr>
<address><a href="mailto:tague@netscape.com">Tague Griffith</a></address> 
</body>
</html>