Changeset 645
- Timestamp:
- 05/30/05 10:20:40 (3 years ago)
- Files:
-
- trunk/wifidog-auth/ChangeLog (modified) (1 diff)
- trunk/wifidog-auth/wifidog/classes/Locale.php (modified) (3 diffs)
- trunk/wifidog-auth/wifidog/classes/MainUI.php (modified) (1 diff)
- trunk/wifidog-auth/wifidog/classes/Style.php (modified) (1 diff)
- trunk/wifidog-auth/wifidog/include/language.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wifidog-auth/ChangeLog
r643 r645 1 2005-05-30 Francois Proulx <francois.proulx@gmail.com> 2 * Changed language selectbox name so it does not clash with ISF's domain cookie 3 * Fixed setlocale algorithm in Locale.php 4 1 5 2005-05-29 Francois Proulx <francois.proulx@gmail.com> 2 6 * Missing null check in validate.php trunk/wifidog-auth/wifidog/classes/Locale.php
r641 r645 84 84 } 85 85 return $object; 86 87 86 } 88 87 … … 94 93 global $session; 95 94 $retval = false; 95 96 // Get new locale ID, assume default if null 96 97 if ($locale != null) 97 98 { … … 106 107 $retval = false; 107 108 } 108 109 109 110 if (GETTEXT_AVAILABLE) 110 { 111 { 112 // Try to set locale 111 113 $current_locale = setlocale(LC_ALL, $locale_id); 112 if (setlocale(LC_ALL, $locale_id) != $locale_id) 114 // Test it against current PHP locale 115 if ($current_locale != $locale_id) 113 116 { 114 117 echo "Warning: language.php: Unable to setlocale() to ".$locale_id.", return value: $current_locale, current locale: ".setlocale(LC_ALL, 0); 118 $retval = false; 115 119 } 116 117 bindtextdomain('messages', BASEPATH.'/locale'); 118 bind_textdomain_codeset('messages', 'UTF-8'); 119 textDomain('messages'); 120 121 putenv("LC_ALL=".$locale_id); 122 putenv("LANGUAGE=".$locale_id); 123 } 120 else 121 { 122 bindtextdomain('messages', BASEPATH.'/locale'); 123 bind_textdomain_codeset('messages', 'UTF-8'); 124 textDomain('messages'); 125 126 putenv("LC_ALL=".$locale_id); 127 putenv("LANGUAGE=".$locale_id); 128 $session->set(SESS_LANGUAGE_VAR, $locale_id); 129 $retval = true; 130 } 131 } 132 124 133 return $retval; 125 126 134 } 127 135 trunk/wifidog-auth/wifidog/classes/MainUI.php
r637 r645 199 199 $html .= '<form class="language" name="lang_form" method="post" action="'.$_SERVER['REQUEST_URI'].'">'."\n"; 200 200 $html .= _("Language:")."\n"; 201 $html .= "<select name=' lang' onChange='javascript: document.lang_form.submit();'>"."\n";201 $html .= "<select name='wifidog_language' onChange='javascript: document.lang_form.submit();'>"."\n"; 202 202 global $AVAIL_LOCALE_ARRAY; //From config file 203 203 foreach ($AVAIL_LOCALE_ARRAY as $lang_ids => $lang_names) trunk/wifidog-auth/wifidog/classes/Style.php
r553 r645 21 21 /**@file Style.php 22 22 * @author Copyright (C) 2004 Technologies Coeus inc. 23 * @deprecated 2005-05-30 This file is NOT used anymore, kept until we move 24 * SQL stats somewhere else. 23 25 */ 24 26 /*Prevent caching*/ trunk/wifidog-auth/wifidog/include/language.php
r595 r645 4 4 $session = new Session(); 5 5 6 if (!empty ($_REQUEST[' lang']))6 if (!empty ($_REQUEST['wifidog_language'])) 7 7 { 8 Locale::setCurrentLocale(Locale::getObject($_REQUEST[' lang']));8 Locale::setCurrentLocale(Locale::getObject($_REQUEST['wifidog_language'])); 9 9 } 10 10
