I translate the template WP Rentals into Russian, faced with some problems. Can not translate reviews. It is necessary that, depending on the number, the ending of the word changes: 3 reviews, 1 review and so on. Now it’s just done: 1 Reviews. In which file is it edited by the standard?

1 answer 1

http://dimox.name/plural-form-of-nouns/

When you need a text of the form 21 comments.

In the themes functions.php file, insert the function:

function plural_form($number, $after) { $cases = array (2, 0, 1, 1, 1, 2); echo $number.' '.$after[ ($number%100>4 && $number%100<20)? 2: $cases[min($number%10, 5)] ]; } 

And in the place where you need to display text about the number of comments, insert the following code:

 <?php plural_form( get_comments_number(), /* Π²Π°Ρ€ΠΈΠ°Π½Ρ‚Ρ‹ написания для количСства 1, 2 ΠΈ 5 */ array('ΠΊΠΎΠΌΠΌΠ΅Π½Ρ‚Π°Ρ€ΠΈΠΉ','коммСнтария','ΠΊΠΎΠΌΠΌΠ΅Π½Ρ‚Π°Ρ€ΠΈΠ΅Π²') ); ?>