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

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] avb (Alexey Borzov)
The idea has some merit, so I won't close this outright, but the "implementation" gave me a few good laughs. Next time please consider actually running your proposed changes before posting them here. Thanks in advance.
 [2006-06-08 13:25 UTC] avb (Alexey Borzov)
Moving feature requests to HTML_QuickForm2.
 [2011-05-22 17:46 UTC] avb (Alexey Borzov)
-Status: Analyzed +Status: Closed -Assigned To: +Assigned To: avb
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.