ZF-11974: Zend_Translate, Plural - unable to get translation of terms when singular = plural (ex: software)

Issue Type: Bug Created: 2012-01-05T22:46:09.000+0000 Last Updated: 2012-10-19T12:27:33.000+0000 Status: Open Fix version(s): Reporter: JULIEN DOMBRE (moyo) Assignee: Thomas Weidner (thomas) Tags: - Zend_Translate

  • translation

Related issues: Attachments:



trying this call (using gettext adapter)

bq. $translate->plural('Software','Software',2);

never give me the plural or singular translation of the term but only Software.

Is it a limitation of Zend_Translate or a bug ? Without it, complete translations are quite difficult.

Calling bq. $translate->plural('Software','Softwares',2); is not correct because Software have no plural forms.


PS :

po file content : {quote} msgid "Software" msgid_plural "Software" msgstr[0] "Logiciel" msgstr[1] "Logiciels" {quote}

print_r($this->_data); at the end of the Zend_Translate_Adapter_Gettext::_loadTranslationData function {quote} Array ( [fr_FR] => Array ( [Software] => ) ) {quote}


Posted by JULIEN DOMBRE (moyo) on 2012-01-05T22:46:55.000+0000

Sorry problem founded with gettext adapter.

Posted by JULIEN DOMBRE (moyo) on 2012-01-05T23:02:48.000+0000

Commenting this part of Zend_Translate_Adapter_Gettext::_loadTranslationData function

<pre class="literal"> 
                    foreach ($original as $orig) {
                         $this->_data[$locale][$orig] = '';

makes it works... But I do not know why.

Posted by Thomas Weidner (thomas) on 2012-01-15T11:57:40.000+0000

How do you call Zend_Translate? Because it does only read MO files... it does not handle or read PO files.

The implementation has tests on real plural mo-files. So my expectation is that you missed to set the proper plural rules within poedit. Details can only be seen and said when you attach the related mo file.

Posted by JULIEN DOMBRE (moyo) on 2012-01-15T12:05:57.000+0000

Zend_Translate is called by :

<pre class="literal"> 
      $TRANSLATE = new Zend_Translate(array('adapter'        => 'gettext',
                                            'content'        => PATH_OF_THE_MO_FILE,
                                            'locale'         => 'fr_FR,
                                            'disableNotices' => true) 

$TRANSLATE->plural('Software', 'Software', 2);

I will attached mo and po files. These files are generated using transifex.

Posted by JULIEN DOMBRE (moyo) on 2012-01-15T12:08:38.000+0000

How can I attach files to the issue I do not find how ?


Posted by JULIEN DOMBRE (moyo) on 2012-01-15T12:19:40.000+0000

Po and Mo files can be found here :……

Posted by Thomas Weidner (thomas) on 2012-01-15T12:19:51.000+0000

The call looks good on the first hand. On your issue click on "more actions", there you can find "attach files".

Posted by JULIEN DOMBRE (moyo) on 2012-01-15T12:58:05.000+0000

I do not have attach files on more actions. Maybe not sufficient rights. I have put the link to the files.


Posted by JULIEN DOMBRE (moyo) on 2012-03-17T09:32:27.000+0000

Do you have news about that ?

Posted by JULIEN DOMBRE (moyo) on 2012-10-19T12:27:33.000+0000

Same problem on 2.0.x branch but unable to create issue on that project.

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.