Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save cristianstan/ff22d64655e322bac1bd737ea35927b4 to your computer and use it in GitHub Desktop.
Missing singular placeholder, needed for some languages. See https://codex.wordpress.org/I18n_for_WordPress_Developers#Plurals
Replace in comments.php:
=======================
<?php
printf( _nx( 'One comment', 'Comments: %1$s', get_comments_number(), 'comments title', 'urbanpointwp' ), number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
?>
With:
=======================
<?php
$comments_number = get_comments_number();
if ( '1' === $comments_number ) {
/* translators: %s: post title */
printf( _x( 'One Reply to &ldquo;%s&rdquo;', 'comments title', 'urbanpointwp' ), get_the_title() );
} else {
printf(
/* translators: 1: number of comments, 2: post title */
_nx(
'%1$s Reply to &ldquo;%2$s&rdquo;',
'%1$s Replies to &ldquo;%2$s&rdquo;',
$comments_number,
'comments title',
'urbanpointwp'
),
number_format_i18n( $comments_number ),
get_the_title()
);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment