ZF-10875: Zend_Locale_Format does not honor Zend_Registry::set('Zend_Locale', ...);

Issue Type: Improvement Created: 2010-12-28T08:33:56.000+0000 Last Updated: 2012-11-20T21:37:29.000+0000 Status: Open Fix version(s): Reporter: Daniel Berlin (dberlin) Assignee: None Tags: - Zend_Locale

Related issues: Attachments:


The documentation states:

"... simply set an instance of Zend_Locale to the registry with the key 'Zend_Locale'. Then this instance will be used within all locale aware classes of Zend Framework. ..."

But with Zend_Locale_Format this is not true:

--- snip ---

// Just to be sure: set PHP locale to something else setlocale(LC_ALL, "de");

// Instantiate and register a new Zend_Locale $locale_en = new Zend_Locale('en'); Zend_Registry::set('Zend_Locale', $locale_en);

echo Zend_Locale_Format::toNumber(4711.0815); // WRONG: 4.711,0815 (german as per setlocale) echo "

// This works as expected: $date = new Zend_Date(); echo $date->get(Zend_Date::WEEKDAY); // OK - english weekday echo "

// This extra step is required to make it work: Zend_Locale_Format::setOptions(array("locale"=>$locale_en));

echo Zend_Locale_Format::toNumber(4711.0815); // OK: 4,711.0815 (english as per Zend_Locale) echo "

--- snap ---


Posted by Thomas Weidner (thomas) on 2010-12-29T00:45:42.000+0000

A feature which does not exist in a class is an improvement and not a bug :-)

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.