wppaste
WordPress

WP_Locale

Since
2.1.0, 4.6.0
Source
wp-includes/class-wp-locale.php:16
Core class used to store translated data for a locale.

Compatibility

WordPress
since 4.6.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Properties · 11

$weekdaystring[]public
Stores the translated strings for the full weekday names.
$weekday_initialstring[]public
Stores the translated strings for the one character weekday names.
$weekday_abbrevstring[]public
Stores the translated strings for the abbreviated weekday names.
$monthstring[]public
Stores the translated strings for the full month names.
$month_genitivestring[]public
Stores the translated strings for the month names in genitive case, if the locale specifies.
$month_abbrevstring[]public
Stores the translated strings for the abbreviated month names.
$meridiemstring[]public
Stores the translated strings for 'am' and 'pm'.
$text_directionstringpublic
The text direction of the locale language.
$number_formatarraypublic
The thousands separator and decimal point values used for localizing numbers.
$list_item_separatorstringpublic
The separator string used for localizing list item separator.
$word_count_typestringpublic
The word count type of the locale language.

Methods · 14

Source code

#[AllowDynamicProperties]class WP_Locale {	/**	 * Stores the translated strings for the full weekday names.	 *	 * @since 2.1.0	 * @since 6.2.0 Initialized to an empty array.	 * @var string[]	 */	public $weekday = array(); 	/**	 * Stores the translated strings for the one character weekday names.	 *	 * There is a hack to make sure that Tuesday and Thursday, as well	 * as Sunday and Saturday, don't conflict. See init() method for more.	 *	 * @see WP_Locale::init() for how to handle the hack.	 *	 * @since 2.1.0	 * @since 6.2.0 Initialized to an empty array.	 * @var string[]	 */	public $weekday_initial = array(); 	/**	 * Stores the translated strings for the abbreviated weekday names.	 *	 * @since 2.1.0	 * @since 6.2.0 Initialized to an empty array.	 * @var string[]	 */	public $weekday_abbrev = array(); 	/**	 * Stores the translated strings for the full month names.	 *	 * @since 2.1.0	 * @since 6.2.0 Initialized to an empty array.	 * @var string[]	 */	public $month = array(); 	/**	 * Stores the translated strings for the month names in genitive case, if the locale specifies.	 *	 * @since 4.4.0	 * @since 6.2.0 Initialized to an empty array.	 * @var string[]	 */	public $month_genitive = array(); 	/**	 * Stores the translated strings for the abbreviated month names.	 *	 * @since 2.1.0	 * @since 6.2.0 Initialized to an empty array.	 * @var string[]	 */	public $month_abbrev = array(); 	/**	 * Stores the translated strings for 'am' and 'pm'.	 *	 * Also the capitalized versions.	 *	 * @since 2.1.0	 * @since 6.2.0 Initialized to an empty array.	 * @var string[]	 */	public $meridiem = array(); 	/**	 * The text direction of the locale language.	 *	 * Default is left to right 'ltr'.	 *	 * @since 2.1.0	 * @var string	 */

Changelog

Introduced in 2.1.0. One change between 6.7.7 and 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

6.8.8
Method get_month_genitive() added.verified against source
4.6.0
Moved to its own file from wp-includes/locale.php.from the docblock
2.1.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 6.9.7 tag, from src/wp-includes/class-wp-locale.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.