|
1 <html> |
|
2 <head> |
|
3 <title>nsLocale Scriptability Test</title> |
|
4 |
|
5 </head> |
|
6 |
|
7 <script> |
|
8 |
|
9 var localeService = null; |
|
10 var applicationLocale = null; |
|
11 var systemLocale = null; |
|
12 |
|
13 function get_locale_service() { |
|
14 localeService = Components.classes["@mozilla.org/intl/nslocaleservice;1"].createInstance(); |
|
15 localeService = localeService.QueryInterface(Components.interfaces.nsILocaleService); |
|
16 applicationLocale = localeService.GetApplicationLocale(); |
|
17 systemLocale = localeService.GetSystemLocale(); |
|
18 } |
|
19 |
|
20 function do_application_locale(t) { |
|
21 t.value = applicationLocale.GetCategory("NSILOCALE_MESSAGES"); |
|
22 } |
|
23 |
|
24 function do_system_locale(t) { |
|
25 t.value = systemLocale.GetCategory("NSILOCALE_MESSAGES"); |
|
26 } |
|
27 |
|
28 </script> |
|
29 |
|
30 <body BGCOLOR="#FFFFFF" TEXT="#000000" onLoad="get_locale_service();"> |
|
31 |
|
32 <form name="locale"> |
|
33 <b>Application Locale: </b> |
|
34 <input type="button" value="Get Application Locale" onClick=do_application_locale(this);></br> |
|
35 <b>System Locale: </b> |
|
36 <input type="button" value="Get System Locale" onClick=do_system_locale(this);></br> |
|
37 </form> |
|
38 |
|
39 <hr> |
|
40 <address><a href="mailto:tague@netscape.com">Tague Griffith</a></address> |
|
41 </body> |
|
42 </html> |
|
43 |
|
44 |