WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#39733 new enhancement

List item separator should be a WP_Locale property

Reported by: SergeyBiryukov Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: I18N Keywords:
Focuses: Cc:
PR Number:

Description

Currently, some (most?) themes have a translatable list item separator for displaying a list of categories or tags. See an example in Twenty Seventeen:

/* translators: used between list items, there is a space after the comma */
$separate_meta = __( ', ', 'twentyseventeen' );

One of ru_RU translation team contributors made a point that list item separator is a locale property, and it doesn't make much sense to translate it separately in multiple projects.

We could probably add it as a property of WP_Locale class, in addition to ::number_format['thousands_sep'] and ::number_format['decimal_point'], and there should be a public function like number_format_i18n(), e.g. get_list_item_separator(), for plugins and themes to use. Thoughts?

Change History (1)

#1 @swissspidy
3 years ago

Sounds useful. Besides the default themes there are three instances of __( ', ' ) being used in core. Perhaps more when counting instances of implode( ', ', … ) that could make use of a translatable list item separator.

Note: See TracTickets for help on using tickets.