Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.4.0

Request #5558 Use setlocale to determine language
Submitted: 2005-09-29 12:01 UTC
From: themars at users dot sourceforge dot net Assigned: avb
Status: Closed Package: HTML_QuickForm2
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: 0.6.0    
Subscription  


 [2005-09-29 12:01 UTC] themars at users dot sourceforge dot net
Description: ------------ The HTML_QuickForm_Date element ignores the locale set by setlocale(LC_TIME, $myLocale); Why don't you use that locale if the language property is not explicitly set? If you use the strftime function instead of the date function in the setValue method, you can support it. Test script: --------------- Change the default of the language property to "default": line 72 line 267 Change the line (425): $arr = explode('-', date('w-d-n-Y-h-H-i-s-a-A-W', (int)$value)); into: if ($this->_options['language'] == 'default') { $arr = explode('-', strftime('%w-%d-%m-%Y-%I-%H-%M-%S-%p-%p-%V', (int)$value)); $arr[2] = preg_replace('#^0#', '', $arr[2]); $arr[9] = strtoupper($arr[9]); } else { $arr = explode('-', date('w-d-n-Y-h-H-i-s-a-A-W', (int)$value)); } Expected result: ---------------- if the user does not specify a language, the language specified with setlocale or otherwise the system default language is used. If specified and found, the class behaves as before. Actual result: -------------- The language set by setlocale is ignored.

Comments

 [2006-06-03 15:57 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2006-06-08 13:25 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2011-05-22 17:46 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!