Search code examples
phplocalizationinternationalizationprintfgettext

ngettext doesn't work in the native langage (PHP)


in PHP, ngettext doesn't work in the native langage.

If I code :

printf( ngettext( '%d article avalaible', '%d articles avalaible', 0), 0);

It will return in English (native langage) :

0 articles avalaible

But return the correct form in French (translated with poedit):

0 article disponible

I don't understand why....


Solution

  • OK there is no problem, just my mistake.

    In French when we have a 0, we don't have to put the word in plural. In English, with zero items, we have to put items in plural.