1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/locale/tests/nsLocaleTest.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,44 @@ 1.4 +<html> 1.5 +<head> 1.6 + <title>nsLocale Scriptability Test</title> 1.7 + 1.8 +</head> 1.9 + 1.10 +<script> 1.11 + 1.12 +var localeService = null; 1.13 +var applicationLocale = null; 1.14 +var systemLocale = null; 1.15 + 1.16 +function get_locale_service() { 1.17 + localeService = Components.classes["@mozilla.org/intl/nslocaleservice;1"].createInstance(); 1.18 + localeService = localeService.QueryInterface(Components.interfaces.nsILocaleService); 1.19 + applicationLocale = localeService.GetApplicationLocale(); 1.20 + systemLocale = localeService.GetSystemLocale(); 1.21 +} 1.22 + 1.23 +function do_application_locale(t) { 1.24 + t.value = applicationLocale.GetCategory("NSILOCALE_MESSAGES"); 1.25 +} 1.26 + 1.27 +function do_system_locale(t) { 1.28 + t.value = systemLocale.GetCategory("NSILOCALE_MESSAGES"); 1.29 +} 1.30 + 1.31 +</script> 1.32 + 1.33 +<body BGCOLOR="#FFFFFF" TEXT="#000000" onLoad="get_locale_service();"> 1.34 + 1.35 +<form name="locale"> 1.36 +<b>Application Locale: </b> 1.37 +<input type="button" value="Get Application Locale" onClick=do_application_locale(this);></br> 1.38 +<b>System Locale: </b> 1.39 +<input type="button" value="Get System Locale" onClick=do_system_locale(this);></br> 1.40 +</form> 1.41 + 1.42 +<hr> 1.43 +<address><a href="mailto:tague@netscape.com">Tague Griffith</a></address> 1.44 +</body> 1.45 +</html> 1.46 + 1.47 +