#60590 closed defect (bug) (fixed)
Function wp_remove_surrounding_empty_script_tags should use sprintf with placeholder
Reported by: | swissspidy | Owned by: | kadamwhite |
---|---|---|---|
Milestone: | 6.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Script Loader | Keywords: | good-first-bug has-patch commit |
Focuses: | Cc: |
Description
The function wp_remove_surrounding_empty_script_tags()
currently uses the following function call:
__( 'Function wp_remove_surrounding_empty_script_tags() used incorrectly in PHP.' )
wp_remove_surrounding_empty_script_tags()
should not be translatable.
This should be changed to use sprintf with a placeholder and an accompanying translator comment.
Something like this:
sprintf(
/* translators: %s: wp_remove_surrounding_empty_script_tags() */
__( 'Function %s used incorrectly in PHP.' ),
'wp_remove_surrounding_empty_script_tags()'
);
Change History (7)
This ticket was mentioned in PR #6167 on WordPress/wordpress-develop by naogify.
11 months ago
#1
- Keywords has-patch added; needs-patch removed
#2
@
11 months ago
- Keywords commit added
- Owner set to kadamwhite
- Status changed from new to accepted
I have tested the patch from @naoki0h at WordCamp Kansai Contributor Day and it works as expected. After discussion with @kirasong I'm marking this for commit, since we're before the string freeze.
#5
@
11 months ago
(Note: after rereading the trac workflow keyword guide it seems the i18n-change keyword is intended for use after string freeze, so apologies in advance if this was not the right context to use that. Leaving it in place out of an abundance of caution.)
@kadamwhite commented on PR #6167:
11 months ago
#6
Committed in https://core.trac.wordpress.org/changeset/57699 :tada:
I use sprint to prevent to translate "wp_remove_surrounding_empty_script_tags".
The detailed explanation is as follows, quoted from the track.
( 'Function wp_remove_surrounding_empty_script_tags() used incorrectly in PHP.' )
wp_remove_surrounding_empty_script_tags() should not be translatable.
Trac ticket: https://core.trac.wordpress.org/ticket/60590