WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] _n : plurals with more than 2 forms (2 posts)

  1. Abdessamad Idrissi
    Member
    Posted 3 years ago #

    I'm creating a theme where I need to use the plural form in Arabic (has 5 forms); unfortunately the _n function accepts only 2 forms; singular and plural

    $since = sprintf(_n('%s hour', '%s hours', $hours), $hours);

    how can I bypass this limitation since my theme is in Arabic?

    The arabic plural formula is:
    nplurals=6; plural=n == 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n >= 3 && n <= 10 ? 3 : n >= 11 && n <= 99 ? 4 : 5;

    thanx,

  2. Abdessamad Idrissi
    Member
    Posted 3 years ago #

    actually it works using the english version of plurals; just write the plural as the plural in english then in po edit it will give you to change the other plural forms.. kind of wiered but it works!

Topic Closed

This topic has been closed to new replies.

About this Topic