Make WordPress Core


Ignore:
Timestamp:
02/07/2023 05:26:14 PM (16 months ago)
Author:
audrasjb
Message:

I18N: Introduce word_count_type property to WP_Locale.

This changesets adds a word_count_type property, so that it does not need to be translated separately across multiple projects.

List of changes:

  • New property: WP_Locale::word_count_type.
  • New method: WP_Locale::get_word_count_type().
  • New function: wp_get_word_count_type() as a wrapper for WP_Locale::get_word_count_type().
  • All _x( 'words', 'Word count type. Do not translate!' ) strings have been replaced with a call to wp_get_word_count_type().

Props pedromendonca, desrosj, costdev, mukesh27, johnbillion.
Fixes #56698.

File:
1 edited

Legend:

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

    r55196 r55279  
    18101810    return $wp_locale->get_list_item_separator();
    18111811}
     1812
     1813/**
     1814 * Retrieves the word count type based on the locale.
     1815 *
     1816 * @since 6.2.0
     1817 *
     1818 * @global WP_Locale $wp_locale WordPress date and time locale object.
     1819 *
     1820 * @return string Locale-specific word count type.
     1821 */
     1822function wp_get_word_count_type() {
     1823    global $wp_locale;
     1824
     1825    return $wp_locale->get_word_count_type();
     1826}
Note: See TracChangeset for help on using the changeset viewer.