intl/locale/tests/nsLocaleTest.html

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 <html>
     2 <head>
     3     <title>nsLocale Scriptability Test</title>
     5 </head>
     7 <script>
     9 var localeService = null;
    10 var applicationLocale = null;
    11 var systemLocale = null;
    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 }
    20 function do_application_locale(t) {
    21       t.value = applicationLocale.GetCategory("NSILOCALE_MESSAGES");
    22 }
    24 function do_system_locale(t) {
    25       t.value = systemLocale.GetCategory("NSILOCALE_MESSAGES");
    26 }
    28 </script>
    30 <body BGCOLOR="#FFFFFF" TEXT="#000000" onLoad="get_locale_service();">
    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>
    39 <hr>
    40 <address><a href="mailto:tague@netscape.com">Tague Griffith</a></address> 
    41 </body>
    42 </html>

mercurial