summaryrefslogtreecommitdiffstats
path: root/intl/locale/tests/nsLocaleTest.html
blob: 5b7aa415bf69ea8d6a004c68ca2316566f6315ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<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>