I18N: Add missing translator comments for strings with trailing spaces for 7.1 - #11946
I18N: Add missing translator comments for strings with trailing spaces for 7.1#11946itzmekhokan wants to merge 3 commits into
Conversation
Add translator comments for translatable strings that include a trailing space after the colon, following the established pattern in WP_PHPMailer. See #64899.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
Thanks for the PR! In these instances, I think we can just move the space out of the translatable string. |
Address review feedback by moving the space after the colon outside of the translatable strings in the_tags() and wp_notify_moderator(). See #64899.
Thanks for the review, @SergeyBiryukov ! Updated the PR to move the trailing spaces out of the translatable strings in the_tags() and wp_notify_moderator() instead of adding translator comments. |
|
This implementation works, but I would personally rather do this with a placeholder: |
There was a problem hiding this comment.
Pull request overview
This PR targets WordPress core i18n string handling for labels that end with a colon and a trailing space, aiming to ensure translation tooling preserves the intended whitespace.
Changes:
- Updated
the_tags()default prefix construction to avoid a trailing space inside the translatable string. - Updated
wp_notify_moderator()trackback/pingback excerpt label construction similarly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/wp-includes/pluggable.php | Adjusts the trackback/pingback excerpt label strings by moving the trailing space outside of __(). |
| src/wp-includes/category-template.php | Adjusts the default the_tags() “Tags:” prefix by moving the trailing space outside of __(). |
Comments suppressed due to low confidence (1)
src/wp-includes/pluggable.php:2104
- Same issue as the trackback label: changing the msgid from
Pingback excerpt:toPingback excerpt:and concatenating a literal space outside__()will invalidate existing translations and diverges from the WP convention of keeping the trailing space in the translatable string with a translator comment (e.g.,src/wp-includes/class-wp-phpmailer.php:51-56).
$notify_message .= __( 'Pingback excerpt:' ) . ' ' . "\r\n" . $comment_content . "\r\n\r\n";
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function the_tags( $before = null, $sep = ', ', $after = '' ) { | ||
| if ( null === $before ) { | ||
| $before = __( 'Tags: ' ); | ||
| $before = __( 'Tags:' ) . ' '; |
| /* translators: %s: Trackback/pingback/comment author URL. */ | ||
| $notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n"; | ||
| $notify_message .= __( 'Trackback excerpt: ' ) . "\r\n" . $comment_content . "\r\n\r\n"; | ||
| $notify_message .= __( 'Trackback excerpt:' ) . ' ' . "\r\n" . $comment_content . "\r\n\r\n"; |
This PR adds missing translator comments for translatable strings that include a trailing space after the colon, as part of the WordPress 7.1 I18N string improvements.
Changes
the_tags()default prefix (Tags:) incategory-template.php.Trackback excerpt:andPingback excerpt:) inwp_notify_moderator()withinpluggable.php.These follow the established pattern used in
WP_PHPMailer(/* translators: There is a space after the colon. */) so translation tooling (WP-CLIi18n make-pot, Poedit) correctly preserves the trailing space for translators.Trac ticket: https://core.trac.wordpress.org/ticket/64899
Use of AI Tools
N/A
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.