• The _n function (and similar, here) seems to be amazingly inadequate, since in certain languages you have more than the singular and plural variants: in Russian for instance you have singular, plural under 4 and plural.

    Basically in literal translation Russian sounds like this: one comment, three of comment, seven of comments.

    How to go about implementing such a variant or working around this problem?

Viewing 4 replies - 1 through 4 (of 4 total)
  • So why can’t you use

    _n( '%s star', '%s of stars', $rating, 'your_textdomain' ), $rating );

    Thread Starter unalignedcoder

    (@unalignedcoder)

    why? well, because 1) it has two closing brackets and 2) I don’t understand how this is supposed to help.

    My “literal translation” of Russian above was just to clarify the problem. Things need to output in Russian (duh).

    one comment = один комментарий
    two comments = два комментария
    five comments = пять комментарии

    If you look at the endings above you can clearly see that this language needs three different endings to cover its plurals correctly (not even considering that the number 21, or 31 etc, need the same singular ending as the number 1), where _n only allows two of those, forcing the developer to make a choice between being ungrammatical with numbers 2,3,4 or being ungrammatical with all the other numbers above 4.

    You should be asking in https://ru.forums.www.ads-software.com/ Maybe someone is aleady working on the issue.

    Thread Starter unalignedcoder

    (@unalignedcoder)

    The answer seems to be actually contained in this page: https://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html
    but I’m not sure how should I use this… how should I write my _n?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘the _n function seems to be quite inadequate’ is closed to new replies.