Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

Added footer translator comment #237

Merged
merged 17 commits into from
Nov 29, 2018

Conversation

khleomix
Copy link
Contributor

Amendment for task #171 (see PR #188)

@kjellr @grappler please check if this works. Thanks

@grappler
Copy link
Member

@khleomix Thank you for the change. My comment in #188 was to make aware of the issue of all of the cases in the theme. I did not want to comment on each and every case.

Do you think you could add the translator comments to all of the cases where it is needed?

@khleomix
Copy link
Contributor Author

@grappler got it, was wondering about that as well. Will have to get back to this tomorrow though. Will update. Thanks!

@khleomix
Copy link
Contributor Author

@grappler please check if I've covered everything. Thanks

Copy link
Member

@grappler grappler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nearly there. I have added some comments inline

I found the following warnings:

Warning: The string "Edit <span class="screen-reader-text">%s</span>" has 2 different translator comments. (inc/template-tags.php:118)
Warning: The string "%d response" contains placeholders but has no "translators:" comment to clarify their meaning. (template-parts/post/discussion-meta.php:19)
Warning: The string "%d other" contains placeholders but has no "translators:" comment to clarify their meaning. (template-parts/post/discussion-meta.php:20)

footer.php Outdated
@@ -18,6 +18,7 @@
<div class="site-info">
<a class="site-name" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>,
<a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentynineteen' ) ); ?>" class="imprint">
<?php /* translators: %s: CMS name, i.e. WordPress. */ ?>
<?php printf( __( 'Proudly powered by %s', 'twentynineteen' ), 'WordPress' ); ?>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I am looking at the code again I am wondering why the string can't be just "Proudly powered by WordPress". It is not like this theme can be installed in another CMS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grappler You're right, I copied that over from the Gutenberg Starter Theme (https://github.com/WordPress/gutenberg-starter-theme/blob/master/footer.php) will update and fix as per your comments.

Copy link
Member

@grappler grappler Oct 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I meant the code should be

_e( 'Proudly powered by WordPress', 'twentynineteen' );

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no worries :) added.

@@ -11,8 +11,10 @@
* Prints HTML with meta information for the current post-date/time.
*/
function twentynineteen_posted_on() {
/* translators: 1: post date in Full Date/Time. 2: post date in F j, Y. */
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no internationalization function used here the translator comment is not needed.

$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
/* translators: 1: post date in Full Date/Time. 2: post date in F j, Y. 3: updated post date in Full Date/Time. 2: updated post date in F j Y. */
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@@ -25,6 +27,7 @@ function twentynineteen_posted_on() {
);

printf(
/* translators: 1: SVG icon, 2: link to post */
'<span class="posted-on">%1$s<a href="%2$s" rel="bookmark">' . $time_string . '</a></span>',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

/* translators: 1: SVG icon. 2: post author, only visible to screen readers. 3: author link. */
'<span class="byline">%1$s<span class="screen-reader-text">%2$s</span><span class="author vcard"><a class="url fn n" href="%3$s">%4$s</a></span></span>',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

@@ -9,6 +9,7 @@
if ( (bool) get_the_author_meta( 'description' ) ) : ?>
<div class="author-description">
<h2 class="author-title">
<?php /* translators: %s: post author */ ?>
<span class="author-heading"><?php echo esc_html( sprintf( __( 'Published by %s', 'twentynineteen' ), get_the_author() ) ); ?></span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Though I would have written the code as

printf(
	/* translators: %s: post author */
	__( 'Published by %s', 'twentynineteen' ),
	esc_html( get_the_author() )
);

@khleomix
Copy link
Contributor Author

@grappler please recheck and let me know if there are more changes.

Copy link
Member

@grappler grappler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

sprintf( _n( '%d response', '%d responses', $discussion->responses, 'twentynineteen' ), $discussion->responses ),
/* translators: %d(X others)$s */
sprintf( _n( '%d other', '%d others', $discussion->commenters, 'twentynineteen' ), $discussion->commenters )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #218.

@allancole allancole added this to the 5.0 milestone Nov 24, 2018
@allancole allancole merged commit b6a7cc9 into WordPress:master Nov 29, 2018
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request Dec 14, 2018
This commit brings over several changes that occurred upstream in the theme’s GitHub repository into core.

- Fixes some minor code quality issues. WordPress/twentynineteen#237
- Fix PHP Warning: Parameter must be an array or an object that implements Countable. WordPress/twentynineteen#661
- Add missing text domain and escaping to comment author text. WordPress/twentynineteen#274
- Remove hyphens rule for cover image text. WordPress/twentynineteen#691

Props khleomix, grapplerulrich, iCaleb, kjellr, allancole.

See #45424.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@44199 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Dec 15, 2018
This commit brings over several changes that occurred upstream in the theme’s GitHub repository into core.

- Fixes some minor code quality issues. WordPress/twentynineteen#237
- Fix PHP Warning: Parameter must be an array or an object that implements Countable. WordPress/twentynineteen#661
- Add missing text domain and escaping to comment author text. WordPress/twentynineteen#274
- Remove hyphens rule for cover image text. WordPress/twentynineteen#691

Props khleomix, grapplerulrich, iCaleb, kjellr, allancole.

See #45424.
Built from https://develop.svn.wordpress.org/branches/5.0@44199


git-svn-id: http://core.svn.wordpress.org/branches/5.0@44029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
gMagicScott pushed a commit to gMagicScott/core.wordpress-mirror that referenced this pull request Dec 15, 2018
This commit brings over several changes that occurred upstream in the theme’s GitHub repository into core.

- Fixes some minor code quality issues. WordPress/twentynineteen#237
- Fix PHP Warning: Parameter must be an array or an object that implements Countable. WordPress/twentynineteen#661
- Add missing text domain and escaping to comment author text. WordPress/twentynineteen#274
- Remove hyphens rule for cover image text. WordPress/twentynineteen#691

Props khleomix, grapplerulrich, iCaleb, kjellr, allancole.

See #45424.
Built from https://develop.svn.wordpress.org/branches/5.0@44199


git-svn-id: https://core.svn.wordpress.org/branches/5.0@44029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
nylen pushed a commit to nylen/wordpress-develop-svn that referenced this pull request Dec 18, 2018
This commit brings over several changes that occurred upstream in the theme’s GitHub repository into core.

- Fix the gallery caption link color. WordPress/twentynineteen#687
- Remove left padding from pullquote blocks. WordPress/twentynineteen#690
- Print `skip-link-focus-fix` inline instead of enqueueing as blocking script. https://github
.com/WordPress/twentynineteen/pull/47
- Fix and improve some strings with placeholders. WordPress/twentynineteen#217
- Fixes some minor code quality issues. WordPress/twentynineteen#237
- Fix PHP Warning: Parameter must be an array or an object that implements Countable. https://github
.com/WordPress/twentynineteen/pull/661
- Add missing text domain and escaping to comment author text. WordPress/twentynineteen#274
- Remove hyphens rule for cover image text. WordPress/twentynineteen#691
- Fix left/right-aligned pullquote spacing. WordPress/twentynineteen#695
- Improve `readme.txt` to follow the correct standards for themes. WordPress/twentynineteen#689

Props kjellr, allancole, dimadin, westonruter, khleomix, grapplerulrich, iCaleb, desrosj.

Merges [44196], [44199], and [44201-44202] into trunk.

Fixes #45424.

git-svn-id: https://develop.svn.wordpress.org/trunk@44305 602fd350-edb4-49c9-b593-d223f7449a82
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request Dec 18, 2018
This commit brings over several changes that occurred upstream in the theme’s GitHub repository into core.

- Fix the gallery caption link color. WordPress/twentynineteen#687
- Remove left padding from pullquote blocks. WordPress/twentynineteen#690
- Print `skip-link-focus-fix` inline instead of enqueueing as blocking script. https://github
.com/WordPress/twentynineteen/pull/47
- Fix and improve some strings with placeholders. WordPress/twentynineteen#217
- Fixes some minor code quality issues. WordPress/twentynineteen#237
- Fix PHP Warning: Parameter must be an array or an object that implements Countable. https://github
.com/WordPress/twentynineteen/pull/661
- Add missing text domain and escaping to comment author text. WordPress/twentynineteen#274
- Remove hyphens rule for cover image text. WordPress/twentynineteen#691
- Fix left/right-aligned pullquote spacing. WordPress/twentynineteen#695
- Improve `readme.txt` to follow the correct standards for themes. WordPress/twentynineteen#689

Props kjellr, allancole, dimadin, westonruter, khleomix, grapplerulrich, iCaleb, desrosj.

Merges [44196], [44199], and [44201-44202] into trunk.

Fixes #45424.

git-svn-id: https://develop.svn.wordpress.org/trunk@44305 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Dec 19, 2018
This commit brings over several changes that occurred upstream in the theme’s GitHub repository into core.

- Fix the gallery caption link color. WordPress/twentynineteen#687
- Remove left padding from pullquote blocks. WordPress/twentynineteen#690
- Print `skip-link-focus-fix` inline instead of enqueueing as blocking script. https://github
.com/WordPress/twentynineteen/pull/47
- Fix and improve some strings with placeholders. WordPress/twentynineteen#217
- Fixes some minor code quality issues. WordPress/twentynineteen#237
- Fix PHP Warning: Parameter must be an array or an object that implements Countable. https://github
.com/WordPress/twentynineteen/pull/661
- Add missing text domain and escaping to comment author text. WordPress/twentynineteen#274
- Remove hyphens rule for cover image text. WordPress/twentynineteen#691
- Fix left/right-aligned pullquote spacing. WordPress/twentynineteen#695
- Improve `readme.txt` to follow the correct standards for themes. WordPress/twentynineteen#689

Props kjellr, allancole, dimadin, westonruter, khleomix, grapplerulrich, iCaleb, desrosj.

Merges [44196], [44199], and [44201-44202] into trunk.

Fixes #45424.
Built from https://develop.svn.wordpress.org/trunk@44305


git-svn-id: http://core.svn.wordpress.org/trunk@44135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
gMagicScott pushed a commit to gMagicScott/core.wordpress-mirror that referenced this pull request Dec 19, 2018
This commit brings over several changes that occurred upstream in the theme’s GitHub repository into core.

- Fix the gallery caption link color. WordPress/twentynineteen#687
- Remove left padding from pullquote blocks. WordPress/twentynineteen#690
- Print `skip-link-focus-fix` inline instead of enqueueing as blocking script. https://github
.com/WordPress/twentynineteen/pull/47
- Fix and improve some strings with placeholders. WordPress/twentynineteen#217
- Fixes some minor code quality issues. WordPress/twentynineteen#237
- Fix PHP Warning: Parameter must be an array or an object that implements Countable. https://github
.com/WordPress/twentynineteen/pull/661
- Add missing text domain and escaping to comment author text. WordPress/twentynineteen#274
- Remove hyphens rule for cover image text. WordPress/twentynineteen#691
- Fix left/right-aligned pullquote spacing. WordPress/twentynineteen#695
- Improve `readme.txt` to follow the correct standards for themes. WordPress/twentynineteen#689

Props kjellr, allancole, dimadin, westonruter, khleomix, grapplerulrich, iCaleb, desrosj.

Merges [44196], [44199], and [44201-44202] into trunk.

Fixes #45424.
Built from https://develop.svn.wordpress.org/trunk@44305


git-svn-id: https://core.svn.wordpress.org/trunk@44135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
svn2github pushed a commit to svn2github/wp-svn-2-git that referenced this pull request Dec 21, 2018
This commit brings over several changes that occurred upstream in the theme’s GitHub repository into core.

- Fix the gallery caption link color. WordPress/twentynineteen#687
- Remove left padding from pullquote blocks. WordPress/twentynineteen#690
- Print `skip-link-focus-fix` inline instead of enqueueing as blocking script. https://github
.com/WordPress/twentynineteen/pull/47
- Fix and improve some strings with placeholders. WordPress/twentynineteen#217
- Fixes some minor code quality issues. WordPress/twentynineteen#237
- Fix PHP Warning: Parameter must be an array or an object that implements Countable. https://github
.com/WordPress/twentynineteen/pull/661
- Add missing text domain and escaping to comment author text. WordPress/twentynineteen#274
- Remove hyphens rule for cover image text. WordPress/twentynineteen#691
- Fix left/right-aligned pullquote spacing. WordPress/twentynineteen#695
- Improve `readme.txt` to follow the correct standards for themes. WordPress/twentynineteen#689

Props kjellr, allancole, dimadin, westonruter, khleomix, grapplerulrich, iCaleb, desrosj.

Merges [44196], [44199], and [44201-44202] into trunk.

Fixes #45424.
Built from https://develop.svn.wordpress.org/trunk@44305


git-svn-id: http://core.svn.wordpress.org/trunk@44135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants