clementine-player / Clementine

:tangerine: Clementine Music Player
https://www.clementine-player.org/
GNU General Public License v3.0
3.77k stars 677 forks source link

translations of singular and plural forms #6184

Open ati3 opened 6 years ago

ati3 commented 6 years ago

Actual behaviour

In transifex are lots of strings with the form "number plural_of_aword" like " albums" or "_ days". Then there is a separate singular form like "1 day".

Expected behaviour

Some languages like slovak have separate plural forms for a few (2-4) and for a lot (5-). Transifex can handle all the forms of a translation in one. Please use this functionality. Without it the strings cannot be translated correctly into these languages.

fitojb commented 6 years ago

Just wanted to point this out: it’s not Transifex’s feature — it’s Gettext’s. https://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/Plural-forms.html

ati3 commented 6 years ago

Sorry, I am not sure how it works, just saw it in other projects. I am just a translator.

tomachinz commented 6 years ago

Thanks this is interesting. That is an awesome page about plurals friend. So to summarise...

Not like this:

   if (n == 1)
     printf ("%d file deleted", n);
   else
     printf ("%d files deleted", n);

More like this: printf (ngettext ("One file removed", "%d files removed", n), n);

Where should I go to read up on Javascript internationalisation please? Thanks!