Forums

[Plugin: 2-4 comment fix] work with 22-24, 32-34 etc. and with 1, 21, 31 (1 post)

  1. Flector
    Member
    Posted 1 year ago #

    replace code
    if ( $number > 4)
    $output = str_replace('%', $number, ( false === $more) ? __('% Comments') : $more);
    elseif ( ( $number > 1 ) and ( $number < 5 ) )
    $output = str_replace('%', $number, ( false === $twotofour ) ? __('% Comments') : $twotofour);
    elseif ( $number == 0 )
    $output = ( false === $zero ) ? __('No Comments') : $zero;
    else // must be one
    $output = ( false === $one ) ? __('1 Comment') : $one;

    with

    if ( $number == 0) {
    		$output = ( false === $zero ) ? __('No Comments') : $zero; }
    	elseif ((($number > 1) && ($number < 5)) || ((($number % 10) > 1) && (($number % 10) < 5)) && ($number > 20)) {
    		$output = str_replace('%', $number, ( false === $twotofour ) ? __('% Comments') : $twotofour); }
    	elseif ((($number > 20) && (($number % 10) == 1)) || ($number == 1)) {
    		$output = str_replace('%', $number, ( false === $one ) ? __('% Comment') : $one); }
    	else {
    	$output = str_replace('%', $number, ( false === $more) ? __('% Comments') : $more); }

    it's resolve problem with 22-24, 32-34 and 21, 31, 41, etc with russian language.

    http://wordpress.org/extend/plugins/2-4-comment-fix/

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 1 year ago by Flector
  • WordPress version: 2.5.1
  • This topic is not a support question