what WordPress core functions do I have to modify to change
comments_popup_link('Ni komentarjev', '1 komentar','% komentarjev')
to
comments_popup_link('Ni komentarjev', '1 komentar', **'2 komentarja',** '% komentarjev')
I’d like to add an argument for 2 comments. And what lines to add to this functions?
The reason why would I want to do that is simply the fact that in my home language we start plural by 3. I want it to be spelled correctly.
1 Answer
Filter 'comments_number'
. You get the translated number and the real number as arguments. Return what fits best.
Sample code:
add_filter( 'comments_number', 'wpse_31328_comments_number_i18n', 10, 2 );
function wpse_31328_comments_number_i18n( $text, $number )
{
if ( 2 === $number )
{
return _x( '2 comments', 'comments number', 'your_text_domain' );
// or hard coded:
// return '2 komentarja';
}
return $text
}