[wp-trac] [WordPress Trac] #52047: Twenty Twenty-One: Remove untranslatable post type names
WordPress Trac
noreply at wordpress.org
Mon Dec 21 16:55:24 UTC 2020
#52047: Twenty Twenty-One: Remove untranslatable post type names
------------------------------+---------------------
Reporter: SergeyBiryukov | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.6.1
Component: Bundled Theme | Version: 5.6
Severity: normal | Resolution:
Keywords: has-patch commit | Focuses:
------------------------------+---------------------
Changes (by SergeyBiryukov):
* keywords: has-patch => has-patch commit
Comment:
Replying to [comment:11 desrosj]:
> The `Newer/Previous` and `posts` parts are still separated. I know this
is because the latter has markup surrounding it, but those problems
persist with this.
Right, it's always better to have a full sentence for translation, even
with some HTML in it, than several parts concatenated together.
[attachment:"52047.2.diff"] is my take on this:
* Note that we don't need `esc_html__()` here, as core translations are
considered safe, see previous discussions in comment:10:ticket:30724,
#47385, #48161, #49190, #49535, #49536, #49537, etc. Overzealous escaping
seems to come from `_s` or other themes following the WordPress.com VIP
guidelines, or Theme Check suggestions, however not all of them apply to
bundled themes. Previous bundled themes only escaped string when necessary
(e.g. when used in attributes), but almost never as a security precaution
with `esc_html()`. It looks like some new instances were introduced lately
though, specifically with block patterns. Removing unnecessary escaping
from Twenty Twenty-One would be something for another ticket.
* While refreshing the patch, I also noticed that one string uses a space
at the end, which also goes against the i18n best practices, as this can
easily be missed, even with a translation comment:
{{{
/* translators: There is a space after page. */
'before_page_number' => esc_html__( 'Page ', 'twentytwentyone' ),
}}}
If the space is required, it should be added in code, not as a
translation. That would not cause any problems with RTL, if that was a
concern here, as the label would just follow the text direction as for the
rest of the page. This is also addressed in the patch.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52047#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list