Skip to content

Bundled Themes: Place translator comments directly before their strings - #16071

Open
mukeshpanchal27 wants to merge 3 commits into
WordPress:trunkfrom
mukeshpanchal27:fix/themes-translator-comment-placement
Open

mukeshpanchal27 wants to merge 3 commits into
WordPress:trunkfrom
mukeshpanchal27:fix/themes-translator-comment-placement

Conversation

@mukeshpanchal27

@mukeshpanchal27 mukeshpanchal27 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

This is the bundled themes counterpart of #16069, which fixes the same problem in core.

Some translator comments share a line with a second translatable string. String extraction then attaches the comment to both strings, so translators see a wrong comment on the second one:

Theme Comment Also attached to
Twenty Ten, Eleven, Twelve, Thirteen, Fourteen (archive.php) %s: Date. on the monthly and yearly archive titles the F Y and Y date format strings
Twenty Fourteen (inc/customizer.php) the Featured Content help text placeholders the featured tag slug

This PR moves each comment directly before the gettext call it describes, and moves the second string to a later line. No strings change, so translations are not affected.

Twenty Seventeen has a related problem. In single.php, "Previous" and "Next" are visible labels, but they share a translation entry with the hidden labels in comments.php. Translators only saw "Hidden accessibility text." for them. This PR moves the single.php comments directly before "Previous Post" and "Next Post", and adds a comment for the visible use. The shared entry now describes both uses:

#. translators: Hidden accessibility text.
#. translators: Visible label for the link to the previous post.
#: comments.php:72
#: single.php:38
msgid "Previous"

How I verified it

I ran wp i18n make-pot on all six themes, before and after the change, and compared the output without the file references.

  • On trunk, the date format strings and the featured slug carry wrong comments.
  • With this PR, those 11 wrong comments are gone. Every other string keeps exactly the same comment, and the strings the comments describe still have them.
  • In Twenty Seventeen, the only change is the new comment on "Previous" and "Next", shown above.

php -l and PHPCS pass on all changed files.

Side note, not changed here: the Twenty Fourteen help text comment lists four placeholders, but the string has three, and %2$s is the Customizer URL, not a post editor URL. That could be fixed separately, because it changes the comment text.

Trac ticket: Needs a ticket. Follow-up to the core change in #16069.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Finding the affected strings, making the change, and checking the POT output before and after. I reviewed the final change.


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.

🤖 Generated with Claude Code

Some translator comments shared a line with a second translatable string, so string extraction attached them to both strings:

- In Twenty Ten, Twenty Eleven, Twenty Twelve, Twenty Thirteen and Twenty Fourteen, the "%s: Date." comment for the monthly and yearly archive titles was also attached to the date format strings.
- In Twenty Fourteen, the comment for the Featured Content help text was also attached to the "featured" tag slug.
- In Twenty Seventeen, the "Hidden accessibility text." comment for "Previous Post" and "Next Post" was also attached to the visible "Previous" and "Next" labels.

This moves each comment directly before the gettext call it describes. No string changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props mukesh27.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub or WordPress.org user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The 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

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The shared translator comments still describe “Previous” and “Next” as hidden accessibility text despite their visible use, and should be clarified without changing translation keys.

1 open issue
What changed in this PR

Moves translator comments directly before their intended gettext calls across six bundled themes, following the core change in #16069. Translatable strings and rendered output remain unchanged.

Changes:

  • Separate archive-title translations from date-format translations.
  • Reposition the Twenty Fourteen Featured Content help comment.
  • Separate Twenty Seventeen’s hidden navigation labels from visible labels.
File Description
src/​wp-content/​themes/​twentytwelve/​archive.php Repositions monthly and yearly archive-title comments.
src/​wp-content/​themes/​twentythirteen/​archive.php Repositions monthly and yearly archive-title comments.
src/​wp-content/​themes/​twentyten/​archive.php Repositions monthly and yearly archive-title comments.
src/​wp-content/​themes/​twentyseventeen/​single.php Places accessibility comments directly before hidden-label translations.
src/​wp-content/​themes/​twentyfourteen/​inc/​customizer.php Separates the help-text comment from the featured-tag translation.
src/​wp-content/​themes/​twentyfourteen/​archive.php Repositions monthly and yearly archive-title comments.
src/​wp-content/​themes/​twentyeleven/​archive.php Repositions monthly and yearly archive-title comments.

Review effort: Balanced

mukeshpanchal27 and others added 2 commits November 17, 2026 20:14
…nslators.

"Previous" and "Next" are hidden labels in `comments.php` and visible labels in `single.php`. Both uses share one translation entry, so translators only saw the "Hidden accessibility text." comment. This adds a comment for the visible use, so the entry describes both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the translator-comment changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants