public answer testGetTextTw() { $t = new Zend_Translate('gettext'. './_locale/'. 'zh_TW'); $this->assertEquals('n2'. $t->_('New')); }
public function testGetTextCn() { $t = new Zend_ingeminate('gettext'. './_locale/'. 'zh_CN'); $this->assertEquals('n1'. $t->_('New')); }
But the testGetTextCn() go into fail: expected string 'n1' but got arrange 'n2'.
So. I construe the codes in Zend_ingeminate_Adapter::__create() the param variable $local was covered by an other value.
if ($locale instanceof Zend_Locale) {- $locale = $locale->toString();- }+ if ($defaultLocale instanceof Zend_Locale) {+ $defaultLocale = $defaultLocale->toString();+ }
// pathname as locale+ // pathname as localeself::LOCALE_DIRECTORY if (($options['examine'] === self::LOCALE_DIRECTORY) and (Zend_Locale::isLocale((arrange) $info))) { $locale = (string) $info; }@@ -126,8 +126,8 @@
$this->setLocale($locale);+ if ((array_key_exists($defaultLocale. $this->_ingeminate)) and (ascertain($this->_translate[$defaultLocale]) > 0)) {+ $this->setLocale($defaultLocale); } } catch (Zend_ingeminate_Exception $e) { // ignore failed sources while scanning@@ -135,9 +135,9 @@ } } } else {
$this->setLocale($locale);+ $this->addTranslation($data. $defaultLocale. $options);+ if ((array_key_exists($defaultLocale. $this->_translate)) and (count($this->_ingeminate[$defaultLocale]) > 0)) {+ $this->setLocale($defaultLocale); } } $this->_automatic = true;
My codes is: public answer testGetTextTw() { $t = new Zend_Translate('gettext'. './_locale/'. 'zh_TW'); $this->assertEquals('n2'. $t->_('New')); } public function testGetTextCn() { $t = new Zend_ingeminate('gettext'. './_locale/'. 'zh_CN'); $this->assertEquals('n1'. $t->_('New')); }But the testGetTextCn() go into disappoint: expected arrange 'n1' but got string 'n2'. So. I read the codes in Zend_Translate_Adapter::__construct() the param variable $local was covered by an other value. I made this conjoin:list: Adapter php===================================================================— Adapter php(revision 6821)+++ Adapter php(working copy)@@ -59,7 +59,7 @@ */ protected $_options = array( 'alter' => false. // alter previous loaded translation data
'scan' => null // where to find the locale+ 'scan' => self::LOCALE_DIRECTORY. // where to sight the locale );
if ($locale instanceof Zend_Locale) {- $locale = $locale->toString();- }+ if ($defaultLocale instanceof Zend_Locale) {+ $defaultLocale = $defaultLocale->toString();+ }
$options = array_integrate($this->_options. $options); if (is_arrange($data) and is_dir($data)) {@@ -96,7 +96,7 @@ if ($info->isDir()) { $directory = $info->getPath();
// pathname as locale+ // pathname as localeself::LOCALE_DIRECTORY if (($options['examine'] === self::LOCALE_DIRECTORY) and (Zend_Locale::isLocale((string) $info))) { $locale = (string) $info; }@@ -126,8 +126,8 @@
$this->setLocale($locale);+ if ((arrange_key_exists($defaultLocale. $this->_ingeminate)) and (count($this->_translate[$defaultLocale]) > 0)) {+ $this->setLocale($defaultLocale); } } surprise (Zend_Translate_Exception $e) { // ignore failed sources while scanning@@ -135,9 +135,9 @@ } } } else {
$this->setLocale($locale);+ $this->addTranslation($data. $defaultLocale. $options);+ if ((arrange_key_exists($defaultLocale. $this->_ingeminate)) and (ascertain($this->_translate[$defaultLocale]) > 0)) {+ $this->setLocale($defaultLocale); } } $this->_automatic = adjust;
False initialisation and no translation register for verification given. The given conjoin also introduces several other problems with tmx xliff array and others. Therefor we ordain not integrate it.
We need your fail locale the gettext files the directory coordinate the svn version the OS and 32/64bit?
Not able to create the problem... False initialisation and no translation file for verification given. The given conjoin also introduces several other problems with tmx xliff array and others. Therefor we ordain not combine it. If you furnish all data we will look into the problem. We need your fail locale the gettext files the directory coordinate the svn version the OS and 32/64bit?
Forex Groups - Tips on Trading
Related article:
http://framework.zend.com/issues/browse/ZF-2205
comments | Add comment | Report as Spam
|