Make WordPress Core


Ignore:
Timestamp:
03/13/2022 08:01:05 PM (3 years ago)
Author:
audrasjb
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r52832 r52929  
    83728372    return abs( (float) $expected - (float) $actual ) <= $precision;
    83738373}
     8374
     8375/**
     8376 * Retrieves the list item separator based on the locale.
     8377 *
     8378 * @since 6.0.0
     8379 *
     8380 * @global WP_Locale $wp_locale WordPress date and time locale object.
     8381 *
     8382 * @return string Locale specific list item separator.
     8383 */
     8384function wp_get_list_item_separator() {
     8385    global $wp_locale;
     8386    return $wp_locale->get_list_item_separator();
     8387}
Note: See TracChangeset for help on using the changeset viewer.