Issues

ZF-2864: getLocale() returns string instead of expected Zend_Locale

Description

As API Doc says getLocale() should return a Zend_Locale instance. Instead it returns a string like 'de_DE'.


$locale = $translate->getLocale();
Zend_Debug::dump(is_object($locale)); #returns false;
Zend_Debug::dump(is_string($locale)); #returns true;
$lang = $locale->toString();  #Fatal error: Call to a member function toString() on a non-object

Comments

But "de_DE" is the locale.

A Zend_Locale can be * a object of type Zend_Locale * a locale definition string from Zend_Locale

Both are true and valid... Every class which takes a locale must accepts both ways.

Changed the APIdoc to be consistent with the implementation.

I can't tell which version this was fixed for. Thomas, could you please add a rev number in the form rXXXX where X's are digits when you resolve the issue? Thanks.

Fixed with r8672