[wp-trac] [WordPress Trac] #56698: Define 'Word count type' as a WP_Locale property
WordPress Trac
noreply at wordpress.org
Fri Sep 30 13:07:03 UTC 2022
#56698: Define 'Word count type' as a WP_Locale property
---------------------------+-----------------------------
Reporter: pedromendonca | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: I18N | Version: trunk
Severity: normal | Keywords: has-patch
Focuses: |
---------------------------+-----------------------------
i18n: Define Word count type as a WP_Locale property.
As commented on https://core.trac.wordpress.org/ticket/47511#comment:19,
the `word count type` should be added as a locale property, so it doesn't
need to be translated separately across multiple projects.
Many plugins and themes could use it without the need to set their own
`_x( 'words', 'Word count type. Do not translate!' )` translation string.
This proposal has the exact same approach as of the recent creation of
`wp_get_list_item_separator()` on https://github.com/WordPress/wordpress-
develop/commit/a37a72077e90a04e4fa6205c6e99fb6614d3bc0d
This proposal implements the following:
- Define `word count type` as a new WP_Locale property
- Add `wp_get_word_count_type()` as a wrapper for
`WP_Locale::get_word_count_type`
- Replace all `_x( 'words', 'Word count type. Do not translate!' )`
strings with `wp_get_word_count_type()`
Related tickets: #47511, #39733
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56698>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list