#55405 closed defect (bug) (fixed)
i18n: Use a placeholder instead of 'Template' in a message in WP_Theme::__construct()
Reported by: | SergeyBiryukov | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 6.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Themes | Keywords: | good-first-bug has-patch |
Focuses: | Cc: |
Description
There is an error message in WP_Theme::__construct()
:
Template is missing. Standalone themes need to have a %1$s or %2$s template file. <a href="%3$s">Child themes</a> need to have a Template header in the %4$s stylesheet.
Since the Template
word here is literal and is not meant to be translated, it should be moved out of the translatable string and replaced with a placeholder, similar to index.php
or style.css
in the same string.
When working on a patch, please note that the translator comment above the string should be updated too.
Attachments (2)
Change History (10)
This ticket was mentioned in PR #2423 on WordPress/wordpress-develop by kapilpaul.
3 years ago
#1
- Keywords has-patch added; needs-patch removed
This ticket was mentioned in Slack in #core by sergey. View the logs.
2 years ago
SergeyBiryukov commented on PR #2423:
2 years ago
#3
Thanks for the PR!
It looks like I forgot to mention on the ticket that only the latest instance of Template
should be replaced here, specifically in this sentence:
<a href="%3$s">Child themes</a> need to have a Template header in the %4$s stylesheet.
Other instances of the word are fine as is and do need to remain translatable.
#5
follow-up:
↓ 8
@
2 years ago
Thanks for the refresh! It looks like 55405.diff is still not quite correct, as it changes the first sentence instead of the one mentioned in comment:3.
55405.2.diff is what I meant here :)
SergeyBiryukov commented on PR #2423:
2 years ago
#7
#8
in reply to:
↑ 5
@
2 years ago
Replying to SergeyBiryukov:
Thanks for the refresh! It looks like 55405.diff is still not quite correct, as it changes the first sentence instead of the one mentioned in comment:3.
55405.2.diff is what I meant here :)
Ooooh, sorry for the misunderstanding... I'll catch up next time.
Thanks to handle this.
trac-55405: i18n: Use a placeholder instead of 'Template' in a message in WP_Theme::construct()
Trac ticket: https://core.trac.wordpress.org/ticket/55405