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

Description

Hi,

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.

Regards

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}

Comments

Sorry problem founded with gettext adapter.

Commenting this part of Zend_Translate_Adapter_Gettext::_loadTranslationData function

 
                    foreach ($original as $orig) {
                         $this->_data[$locale][$orig] = '';
                    }

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

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.

Zend_Translate is called by :

 
      $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.

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

Thanks

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

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

Regards

Do you have news about that ?

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