A question about comments_number() in loop-*.php

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3158 Reply

    Anonymous

    I used POEDIT to translate the Frontier theme in French and everything is ok. But I still have two texts that was not localized : the comments part in the main page (posts list) and when viewing a post. I found the corresponding lines in loop-blog.php and loop-single.php and changed “<?php comments_number( ‘Comments’, ‘1 Comment’, ‘% Comments’ ); ?>” to “<?php comments_number(); ?>”. This way, I get the translated text from WordPress core. Is there any reason you forced code the english text in comments_number() function so my change can have a misbehavior that I don’t see.
    BTW, thanks for this great theme. It’s the first time that I adopt one as quicky after previewed it.

    #3159 Reply

    Ron
    Keymaster

    Is there any reason you forced code the english text in comments_number()

    No reason at all. I just forgot to make those text translatable 🙂

    I’ve changed this code:

    <?php comments_number( ‘Comments’, ’1 Comment’, ‘% Comments’ ); ?>
    

    To this:

    <?php comments_number( __('Comments', 'frontier'), __('1 Comment', 'frontier'), __('% Comments', 'frontier') ); ?>
    

    The only reason I used the code above instead of simply < ?php comments_number(); ?> is so that when a post has no comments ‘Comments’ will be used instead of ‘No Comments’

    Thanks,
    Ron

    #3160 Reply

    Anonymous

    Ok. Thx.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: A question about comments_number() in loop-*.php
Your information: