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/script-loader.php

    r55275 r55279  
    18321832        'wordCountL10n',
    18331833        array(
    1834             /*
    1835              * translators: If your word count is based on single characters (e.g. East Asian characters),
    1836              * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
    1837              * Do not translate into your own language.
    1838              */
    1839             'type'       => _x( 'words', 'Word count type. Do not translate!' ),
     1834            'type'       => wp_get_word_count_type(),
    18401835            'shortcodes' => ! empty( $GLOBALS['shortcode_tags'] ) ? array_keys( $GLOBALS['shortcode_tags'] ) : array(),
    18411836        )
Note: See TracChangeset for help on using the changeset viewer.