Make WordPress Core


Ignore:
Timestamp:
03/13/2022 08:01:05 PM (2 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-admin/includes/class-wp-posts-list-table.php

    r52215 r52929  
    12951295                $term_links = apply_filters( 'post_column_taxonomy_links', $term_links, $taxonomy, $terms );
    12961296
    1297                 /* translators: Used between list items, there is a space after the comma. */
    1298                 echo implode( __( ', ' ), $term_links );
     1297                echo implode( wp_get_list_item_separator(), $term_links );
    12991298            } else {
    13001299                echo '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . $taxonomy_object->labels->no_terms . '</span>';
Note: See TracChangeset for help on using the changeset viewer.