i18n: Define List item separator as a WP_Locale property.

The list item separator is a locale property, and it doesn't make much sense to translate it separately in multiple projects. This changeset implements the following modifications:

- Define list item separator as a new WP_Locale property
- Add `wp_get_list_item_separator()` as a wrapper for `WP_Locale::get_list_item_separator`
- Replace `$wp_locale->get_list_item_separator()` calls with `wp_get_list_item_separator()`
- Added a compatibility layer for bundled themes

Props SergeyBiryukov, swissspidy, rsiddharth, johnbillion, audrasjb.
Fixes #39733.

Built from https://develop.svn.wordpress.org/trunk@52929


git-svn-id: http://core.svn.wordpress.org/trunk@52518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb
2022-03-13 20:03:01 +00:00
parent 3046b5b3e1
commit 30a77d5fa4
21 changed files with 147 additions and 53 deletions

View File

@@ -924,8 +924,7 @@ final class WP_Theme implements ArrayAccess {
case 'Tags':
static $comma = null;
if ( ! isset( $comma ) ) {
/* translators: Used between list items, there is a space after the comma. */
$comma = __( ', ' );
$comma = wp_get_list_item_separator();
}
$value = implode( $comma, $value );
break;