Conversation
The POT file represented several characters with two different entities,
once numbered and once named, so the same character produced separate
translation strings. This normalises the four duplicated pairs to the
named form:
&WordPress#8212; -> —
&WordPress#187; -> »
&WordPress#8230; -> …
&WordPress#8250; -> ›
Only entities inside translatable strings were changed. The lookup
tables in ent2ncr() and convert_invalid_entities() are left alone, as
those intentionally map named entities to numbered ones, and a single
non-translatable occurrence in wp-trackback.php was left as is.
Props ramiy, Denis-de-Bernardy.
Fixes WordPress#7098.
|
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @skikken. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. |
The POT file represented four characters with two different entities, once numbered and once named. Because the two forms are distinct strings to gettext, the same character generated separate translation strings depending on which form a given file happened to use.
This normalises the four duplicated pairs to the named form in translatable strings only:
Two things are deliberately left alone:
The lookup tables in ent2ncr() and convert_invalid_entities() are unchanged. Those intentionally map named entities to their numbered equivalents, so rewriting them would break entity conversion rather than fix anything. There is no reverse function in core that converts numbered entities back to named ones, which is why the strings themselves are the right place to normalise.
The one occurrence in wp-trackback.php is not a translation string. It is passed as the $more argument to wp_html_excerpt(), so it is not part of the POT file and was not touched.
Trac ticket: https://core.trac.wordpress.org/ticket/7098
Use of AI Tools
AI assistance: Yes
Tool(s): Claude
Model(s): Sonnet
Used for: PR description
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.