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.


git-svn-id: https://develop.svn.wordpress.org/trunk@52929 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jb Audras
2022-03-13 20:01:05 +00:00
parent 89de8f3b35
commit a37a72077e
20 changed files with 146 additions and 52 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;