Merge pull request #1012 from jrfnl/feature/fix-i18n-issue

Fix translatability of comments title
This commit is contained in:
David A. Kennedy 2017-06-08 19:37:17 -04:00 committed by GitHub
commit 97eb58a129
2 changed files with 49 additions and 38 deletions

View File

@ -27,11 +27,21 @@ if ( post_password_required() ) {
if ( have_comments() ) : ?> if ( have_comments() ) : ?>
<h2 class="comments-title"> <h2 class="comments-title">
<?php <?php
printf( // WPCS: XSS OK. $comment_count = get_comments_number();
esc_html( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', '_s' ) ), if ( 1 === $comment_count ) {
number_format_i18n( get_comments_number() ), printf(
'<span>' . get_the_title() . '</span>' /* translators: 1: title. */
); esc_html_e( 'One thought on &ldquo;%1$s&rdquo;', '_s' ),
'<span>' . get_the_title() . '</span>'
);
} else {
printf( // WPCS: XSS OK.
/* translators: 1: comment count number, 2: title. */
esc_html( _nx( '%1$s thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', $comment_count, 'comments title', '_s' ) ),
number_format_i18n( $comment_count ),
'<span>' . get_the_title() . '</span>'
);
}
?> ?>
</h2><!-- .comments-title --> </h2><!-- .comments-title -->

View File

@ -4,13 +4,14 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: _s 1.0.0\n" "Project-Id-Version: _s 1.0.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/tags/_s\n" "Report-Msgid-Bugs-To: https://wordpress.org/tags/_s\n"
"POT-Creation-Date: 2016-02-14 21:43:07+00:00\n" "POT-Creation-Date: 2016-12-23 16:00+0100\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: 2016-12-23 16:00+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: \n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: \n"
#: 404.php:17 #: 404.php:17
#@ _s #@ _s
@ -34,34 +35,39 @@ msgstr ""
msgid "Try looking in the monthly archives. %1$s" msgid "Try looking in the monthly archives. %1$s"
msgstr "" msgstr ""
#: comments.php:31 #. translators: 1: title.
#: comments.php:34
#, php-format
#@ _s
msgid "One thought on &ldquo;%1$s&rdquo;"
msgstr ""
#. translators: 1: comment count number, 2: title.
#: comments.php:40
#, php-format #, php-format
#@ _s #@ _s
msgctxt "comments title" msgctxt "comments title"
msgid "One thought on &ldquo;%2$s&rdquo;" msgid "%1$s thought on &ldquo;%2$s&rdquo;"
msgid_plural "%1$s thoughts on &ldquo;%2$s&rdquo;" msgid_plural "%1$s thoughts on &ldquo;%2$s&rdquo;"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: comments.php:40 #: comments.php:50 comments.php:71
#: comments.php:61
#@ _s #@ _s
msgid "Comment navigation" msgid "Comment navigation"
msgstr "" msgstr ""
#: comments.php:43 #: comments.php:53 comments.php:74
#: comments.php:64
#@ _s #@ _s
msgid "Older Comments" msgid "Older Comments"
msgstr "" msgstr ""
#: comments.php:44 #: comments.php:54 comments.php:75
#: comments.php:65
#@ _s #@ _s
msgid "Newer Comments" msgid "Newer Comments"
msgstr "" msgstr ""
#: comments.php:78 #: comments.php:88
#@ _s #@ _s
msgid "Comments are closed." msgid "Comments are closed."
msgstr "" msgstr ""
@ -88,17 +94,22 @@ msgstr ""
msgid "Primary" msgid "Primary"
msgstr "" msgstr ""
#: functions.php:102 #: functions.php:93
#@ _s #@ _s
msgid "Sidebar" msgid "Sidebar"
msgstr "" msgstr ""
#: header.php:25 #: functions.php:95
#@ _s
msgid "Add widgets here."
msgstr ""
#: header.php:24
#@ _s #@ _s
msgid "Skip to content" msgid "Skip to content"
msgstr "" msgstr ""
#: header.php:45 #: header.php:44
#@ _s #@ _s
msgid "Primary Menu" msgid "Primary Menu"
msgstr "" msgstr ""
@ -118,8 +129,7 @@ msgid "by %s"
msgstr "" msgstr ""
#. translators: used between list items, there is a space after the comma #. translators: used between list items, there is a space after the comma
#: inc/template-tags.php:50 #: inc/template-tags.php:50 inc/template-tags.php:56
#: inc/template-tags.php:56
#@ _s #@ _s
msgid ", " msgid ", "
msgstr "" msgstr ""
@ -136,24 +146,15 @@ msgstr ""
msgid "Tagged %1$s" msgid "Tagged %1$s"
msgstr "" msgstr ""
#. translators: %s: post title
#: inc/template-tags.php:65 #: inc/template-tags.php:65
#, php-format
#@ _s #@ _s
msgid "Leave a Comment<span class=\"screen-reader-text\"> on %s</span>" msgid "Leave a Comment<span class=\"screen-reader-text\"> on %s</span>"
msgstr "" msgstr ""
#: inc/template-tags.php:65
#@ _s
msgid "1 Comment"
msgstr ""
#: inc/template-tags.php:65
#@ _s
msgid "% Comments"
msgstr ""
#. translators: %s: Name of current post #. translators: %s: Name of current post
#: inc/template-tags.php:71 #: inc/template-tags.php:72 template-parts/content-page.php:34
#: template-parts/content-page.php:33
#, php-format #, php-format
#@ _s #@ _s
msgid "Edit %s" msgid "Edit %s"
@ -186,8 +187,7 @@ msgstr ""
msgid "It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help." msgid "It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help."
msgstr "" msgstr ""
#: template-parts/content-page.php:22 #: template-parts/content-page.php:22 template-parts/content.php:38
#: template-parts/content.php:38
#@ _s #@ _s
msgid "Pages:" msgid "Pages:"
msgstr "" msgstr ""
@ -200,6 +200,7 @@ msgid "Continue reading %s <span class=\"meta-nav\">&rarr;</span>"
msgstr "" msgstr ""
#. Theme Name of the plugin/theme #. Theme Name of the plugin/theme
#@ _s
msgid "_s" msgid "_s"
msgstr "" msgstr ""