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

Issue Type: Docs: Problem Created: 2008-03-11T13:19:11.000+0000 Last Updated: 2008-03-21T17:59:06.000+0000 Status: Resolved Fix version(s): - 1.5.1 (25/Mar/08)

Reporter: Thomas Fritz (thomasfr) Assignee: Thomas Weidner (thomas) Tags: - Zend_Translate

Related issues: Attachments:


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

<pre class="highlight">
$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


Posted by Thomas Weidner (thomas) on 2008-03-11T13:34:23.000+0000

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.

Posted by Thomas Weidner (thomas) on 2008-03-11T13:46:05.000+0000

Changed the APIdoc to be consistent with the implementation.

Posted by Wil Sinclair (wil) on 2008-03-21T17:15:45.000+0000

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.

Posted by Thomas Weidner (thomas) on 2008-03-21T17:59:06.000+0000

Fixed with r8672

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.