ZF-2400: Add plural support to GetText Adapter


Plural support in the gettext adapter, would be extremely useful.


Resetting 'fix version priority' and 'fix version' to be re-evaluated for next release.

It should be supported in all translation adapters, not only gettext.

Gogo, gogo-sheep, we need this! :)

Agreed, this should get included for any adapter that supports it and short-circuited on others if there isn't a way to get it done.

There is no need to agree what already has been discussed. As you see this issue is already in progress and is being worked on.

Hi Everybody,

since the assignment was more than one year ago, what is the status of this "work in progres"?

We use gettext plurals and gettext domains in our zend application and need this feature quite badly. This isnt such an issue in english, but in other languages with multiple plural forms (3-6 based on numeric conditions) it is immediately visible. Users view translations without proper plurals as very unprofessional.

Domains are important if u have independent modules/applications which share same library, and you cant translate the library multiple times. Therefore u can use gettext domains to bind multiple "translation sets" into your app.

kind regards for yor help Tibor

Domains are not necessary for Zend_Translate. The actual API supports already what their benefit to PHP's gettext is. Note that domains are not part of the gettext definition but a construct of PHP's gettext extension.

Hi Thomas,

I respect your opinion where you state that you dont need domains in Zend_Translate. Just your opinion doesnt match with the general usage of PHP gettext function.

Despite the speed advantage, there are two major strengths of gettext: plurals and domains.

If you think you dont need them, then you should learn more about them. This two functionalities are a base for professional translation inside applications. Without them we can go back to txt files. There is no other API which has been able to create plural support.

The task is in progress for one year already and it isnt clear where it is going. Could you please state what the situation is, and where the progress stands now?

kind regards Tibor

Zend_Translate does not use PHP's gettext extension because it is not multi-thread aware. Zend_Translate reads the mo files directly, therefor it does not need PHP's workaround.

And even if you don't believe it: Plurals are native to translation in general... they are not unique to gettext.

Since a few weeks plural support is available to 4 adapters within Zend_Translate. But the code is in review by the development team and for now not allowed to be cored. We have to wait until it is reviewed. It should be release with 1.9 as new features are not allowed within mini/bug-fix releases.

This new feature has been accepted and integrated into the core with r16883.