Edit File by line
/home/zeestwma/richards.../wp-inclu...
File: class-wp-locale.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Locale API: WP_Locale class
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage i18n
[5] Fix | Delete
* @since 4.6.0
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* Core class used to store translated data for a locale.
[10] Fix | Delete
*
[11] Fix | Delete
* @since 2.1.0
[12] Fix | Delete
* @since 4.6.0 Moved to its own file from wp-includes/locale.php.
[13] Fix | Delete
*/
[14] Fix | Delete
#[AllowDynamicProperties]
[15] Fix | Delete
class WP_Locale {
[16] Fix | Delete
/**
[17] Fix | Delete
* Stores the translated strings for the full weekday names.
[18] Fix | Delete
*
[19] Fix | Delete
* @since 2.1.0
[20] Fix | Delete
* @since 6.2.0 Initialized to an empty array.
[21] Fix | Delete
* @var string[]
[22] Fix | Delete
*/
[23] Fix | Delete
public $weekday = array();
[24] Fix | Delete
[25] Fix | Delete
/**
[26] Fix | Delete
* Stores the translated strings for the one character weekday names.
[27] Fix | Delete
*
[28] Fix | Delete
* There is a hack to make sure that Tuesday and Thursday, as well
[29] Fix | Delete
* as Sunday and Saturday, don't conflict. See init() method for more.
[30] Fix | Delete
*
[31] Fix | Delete
* @see WP_Locale::init() for how to handle the hack.
[32] Fix | Delete
*
[33] Fix | Delete
* @since 2.1.0
[34] Fix | Delete
* @since 6.2.0 Initialized to an empty array.
[35] Fix | Delete
* @var string[]
[36] Fix | Delete
*/
[37] Fix | Delete
public $weekday_initial = array();
[38] Fix | Delete
[39] Fix | Delete
/**
[40] Fix | Delete
* Stores the translated strings for the abbreviated weekday names.
[41] Fix | Delete
*
[42] Fix | Delete
* @since 2.1.0
[43] Fix | Delete
* @since 6.2.0 Initialized to an empty array.
[44] Fix | Delete
* @var string[]
[45] Fix | Delete
*/
[46] Fix | Delete
public $weekday_abbrev = array();
[47] Fix | Delete
[48] Fix | Delete
/**
[49] Fix | Delete
* Stores the translated strings for the full month names.
[50] Fix | Delete
*
[51] Fix | Delete
* @since 2.1.0
[52] Fix | Delete
* @since 6.2.0 Initialized to an empty array.
[53] Fix | Delete
* @var string[]
[54] Fix | Delete
*/
[55] Fix | Delete
public $month = array();
[56] Fix | Delete
[57] Fix | Delete
/**
[58] Fix | Delete
* Stores the translated strings for the month names in genitive case, if the locale specifies.
[59] Fix | Delete
*
[60] Fix | Delete
* @since 4.4.0
[61] Fix | Delete
* @since 6.2.0 Initialized to an empty array.
[62] Fix | Delete
* @var string[]
[63] Fix | Delete
*/
[64] Fix | Delete
public $month_genitive = array();
[65] Fix | Delete
[66] Fix | Delete
/**
[67] Fix | Delete
* Stores the translated strings for the abbreviated month names.
[68] Fix | Delete
*
[69] Fix | Delete
* @since 2.1.0
[70] Fix | Delete
* @since 6.2.0 Initialized to an empty array.
[71] Fix | Delete
* @var string[]
[72] Fix | Delete
*/
[73] Fix | Delete
public $month_abbrev = array();
[74] Fix | Delete
[75] Fix | Delete
/**
[76] Fix | Delete
* Stores the translated strings for 'am' and 'pm'.
[77] Fix | Delete
*
[78] Fix | Delete
* Also the capitalized versions.
[79] Fix | Delete
*
[80] Fix | Delete
* @since 2.1.0
[81] Fix | Delete
* @since 6.2.0 Initialized to an empty array.
[82] Fix | Delete
* @var string[]
[83] Fix | Delete
*/
[84] Fix | Delete
public $meridiem = array();
[85] Fix | Delete
[86] Fix | Delete
/**
[87] Fix | Delete
* The text direction of the locale language.
[88] Fix | Delete
*
[89] Fix | Delete
* Default is left to right 'ltr'.
[90] Fix | Delete
*
[91] Fix | Delete
* @since 2.1.0
[92] Fix | Delete
* @var string
[93] Fix | Delete
*/
[94] Fix | Delete
public $text_direction = 'ltr';
[95] Fix | Delete
[96] Fix | Delete
/**
[97] Fix | Delete
* The thousands separator and decimal point values used for localizing numbers.
[98] Fix | Delete
*
[99] Fix | Delete
* @since 2.3.0
[100] Fix | Delete
* @since 6.2.0 Initialized to an empty array.
[101] Fix | Delete
* @var array
[102] Fix | Delete
*/
[103] Fix | Delete
public $number_format = array();
[104] Fix | Delete
[105] Fix | Delete
/**
[106] Fix | Delete
* The separator string used for localizing list item separator.
[107] Fix | Delete
*
[108] Fix | Delete
* @since 6.0.0
[109] Fix | Delete
* @var string
[110] Fix | Delete
*/
[111] Fix | Delete
public $list_item_separator;
[112] Fix | Delete
[113] Fix | Delete
/**
[114] Fix | Delete
* The word count type of the locale language.
[115] Fix | Delete
*
[116] Fix | Delete
* Default is 'words'.
[117] Fix | Delete
*
[118] Fix | Delete
* @since 6.2.0
[119] Fix | Delete
* @var string
[120] Fix | Delete
*/
[121] Fix | Delete
public $word_count_type;
[122] Fix | Delete
[123] Fix | Delete
/**
[124] Fix | Delete
* Constructor which calls helper methods to set up object variables.
[125] Fix | Delete
*
[126] Fix | Delete
* @since 2.1.0
[127] Fix | Delete
*/
[128] Fix | Delete
public function __construct() {
[129] Fix | Delete
$this->init();
[130] Fix | Delete
$this->register_globals();
[131] Fix | Delete
}
[132] Fix | Delete
[133] Fix | Delete
/**
[134] Fix | Delete
* Sets up the translated strings and object properties.
[135] Fix | Delete
*
[136] Fix | Delete
* The method creates the translatable strings for various
[137] Fix | Delete
* calendar elements. Which allows for specifying locale
[138] Fix | Delete
* specific calendar names and text direction.
[139] Fix | Delete
*
[140] Fix | Delete
* @since 2.1.0
[141] Fix | Delete
*
[142] Fix | Delete
* @global string $text_direction
[143] Fix | Delete
*/
[144] Fix | Delete
public function init() {
[145] Fix | Delete
// The weekdays.
[146] Fix | Delete
$this->weekday[0] = /* translators: Weekday. */ __( 'Sunday' );
[147] Fix | Delete
$this->weekday[1] = /* translators: Weekday. */ __( 'Monday' );
[148] Fix | Delete
$this->weekday[2] = /* translators: Weekday. */ __( 'Tuesday' );
[149] Fix | Delete
$this->weekday[3] = /* translators: Weekday. */ __( 'Wednesday' );
[150] Fix | Delete
$this->weekday[4] = /* translators: Weekday. */ __( 'Thursday' );
[151] Fix | Delete
$this->weekday[5] = /* translators: Weekday. */ __( 'Friday' );
[152] Fix | Delete
$this->weekday[6] = /* translators: Weekday. */ __( 'Saturday' );
[153] Fix | Delete
[154] Fix | Delete
// The first letter of each day.
[155] Fix | Delete
$this->weekday_initial[ $this->weekday[0] ] = /* translators: One-letter abbreviation of the weekday. */ _x( 'S', 'Sunday initial' );
[156] Fix | Delete
$this->weekday_initial[ $this->weekday[1] ] = /* translators: One-letter abbreviation of the weekday. */ _x( 'M', 'Monday initial' );
[157] Fix | Delete
$this->weekday_initial[ $this->weekday[2] ] = /* translators: One-letter abbreviation of the weekday. */ _x( 'T', 'Tuesday initial' );
[158] Fix | Delete
$this->weekday_initial[ $this->weekday[3] ] = /* translators: One-letter abbreviation of the weekday. */ _x( 'W', 'Wednesday initial' );
[159] Fix | Delete
$this->weekday_initial[ $this->weekday[4] ] = /* translators: One-letter abbreviation of the weekday. */ _x( 'T', 'Thursday initial' );
[160] Fix | Delete
$this->weekday_initial[ $this->weekday[5] ] = /* translators: One-letter abbreviation of the weekday. */ _x( 'F', 'Friday initial' );
[161] Fix | Delete
$this->weekday_initial[ $this->weekday[6] ] = /* translators: One-letter abbreviation of the weekday. */ _x( 'S', 'Saturday initial' );
[162] Fix | Delete
[163] Fix | Delete
// Abbreviations for each day.
[164] Fix | Delete
$this->weekday_abbrev[ $this->weekday[0] ] = /* translators: Three-letter abbreviation of the weekday. */ __( 'Sun' );
[165] Fix | Delete
$this->weekday_abbrev[ $this->weekday[1] ] = /* translators: Three-letter abbreviation of the weekday. */ __( 'Mon' );
[166] Fix | Delete
$this->weekday_abbrev[ $this->weekday[2] ] = /* translators: Three-letter abbreviation of the weekday. */ __( 'Tue' );
[167] Fix | Delete
$this->weekday_abbrev[ $this->weekday[3] ] = /* translators: Three-letter abbreviation of the weekday. */ __( 'Wed' );
[168] Fix | Delete
$this->weekday_abbrev[ $this->weekday[4] ] = /* translators: Three-letter abbreviation of the weekday. */ __( 'Thu' );
[169] Fix | Delete
$this->weekday_abbrev[ $this->weekday[5] ] = /* translators: Three-letter abbreviation of the weekday. */ __( 'Fri' );
[170] Fix | Delete
$this->weekday_abbrev[ $this->weekday[6] ] = /* translators: Three-letter abbreviation of the weekday. */ __( 'Sat' );
[171] Fix | Delete
[172] Fix | Delete
// The months.
[173] Fix | Delete
$this->month['01'] = /* translators: Month name. */ __( 'January' );
[174] Fix | Delete
$this->month['02'] = /* translators: Month name. */ __( 'February' );
[175] Fix | Delete
$this->month['03'] = /* translators: Month name. */ __( 'March' );
[176] Fix | Delete
$this->month['04'] = /* translators: Month name. */ __( 'April' );
[177] Fix | Delete
$this->month['05'] = /* translators: Month name. */ __( 'May' );
[178] Fix | Delete
$this->month['06'] = /* translators: Month name. */ __( 'June' );
[179] Fix | Delete
$this->month['07'] = /* translators: Month name. */ __( 'July' );
[180] Fix | Delete
$this->month['08'] = /* translators: Month name. */ __( 'August' );
[181] Fix | Delete
$this->month['09'] = /* translators: Month name. */ __( 'September' );
[182] Fix | Delete
$this->month['10'] = /* translators: Month name. */ __( 'October' );
[183] Fix | Delete
$this->month['11'] = /* translators: Month name. */ __( 'November' );
[184] Fix | Delete
$this->month['12'] = /* translators: Month name. */ __( 'December' );
[185] Fix | Delete
[186] Fix | Delete
// The months, genitive.
[187] Fix | Delete
$this->month_genitive['01'] = /* translators: Month name, genitive. */ _x( 'January', 'genitive' );
[188] Fix | Delete
$this->month_genitive['02'] = /* translators: Month name, genitive. */ _x( 'February', 'genitive' );
[189] Fix | Delete
$this->month_genitive['03'] = /* translators: Month name, genitive. */ _x( 'March', 'genitive' );
[190] Fix | Delete
$this->month_genitive['04'] = /* translators: Month name, genitive. */ _x( 'April', 'genitive' );
[191] Fix | Delete
$this->month_genitive['05'] = /* translators: Month name, genitive. */ _x( 'May', 'genitive' );
[192] Fix | Delete
$this->month_genitive['06'] = /* translators: Month name, genitive. */ _x( 'June', 'genitive' );
[193] Fix | Delete
$this->month_genitive['07'] = /* translators: Month name, genitive. */ _x( 'July', 'genitive' );
[194] Fix | Delete
$this->month_genitive['08'] = /* translators: Month name, genitive. */ _x( 'August', 'genitive' );
[195] Fix | Delete
$this->month_genitive['09'] = /* translators: Month name, genitive. */ _x( 'September', 'genitive' );
[196] Fix | Delete
$this->month_genitive['10'] = /* translators: Month name, genitive. */ _x( 'October', 'genitive' );
[197] Fix | Delete
$this->month_genitive['11'] = /* translators: Month name, genitive. */ _x( 'November', 'genitive' );
[198] Fix | Delete
$this->month_genitive['12'] = /* translators: Month name, genitive. */ _x( 'December', 'genitive' );
[199] Fix | Delete
[200] Fix | Delete
// Abbreviations for each month.
[201] Fix | Delete
$this->month_abbrev[ $this->month['01'] ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Jan', 'January abbreviation' );
[202] Fix | Delete
$this->month_abbrev[ $this->month['02'] ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Feb', 'February abbreviation' );
[203] Fix | Delete
$this->month_abbrev[ $this->month['03'] ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Mar', 'March abbreviation' );
[204] Fix | Delete
$this->month_abbrev[ $this->month['04'] ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Apr', 'April abbreviation' );
[205] Fix | Delete
$this->month_abbrev[ $this->month['05'] ] = /* translators: Three-letter abbreviation of the month. */ _x( 'May', 'May abbreviation' );
[206] Fix | Delete
$this->month_abbrev[ $this->month['06'] ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Jun', 'June abbreviation' );
[207] Fix | Delete
$this->month_abbrev[ $this->month['07'] ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Jul', 'July abbreviation' );
[208] Fix | Delete
$this->month_abbrev[ $this->month['08'] ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Aug', 'August abbreviation' );
[209] Fix | Delete
$this->month_abbrev[ $this->month['09'] ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Sep', 'September abbreviation' );
[210] Fix | Delete
$this->month_abbrev[ $this->month['10'] ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Oct', 'October abbreviation' );
[211] Fix | Delete
$this->month_abbrev[ $this->month['11'] ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Nov', 'November abbreviation' );
[212] Fix | Delete
$this->month_abbrev[ $this->month['12'] ] = /* translators: Three-letter abbreviation of the month. */ _x( 'Dec', 'December abbreviation' );
[213] Fix | Delete
[214] Fix | Delete
// The meridiems.
[215] Fix | Delete
$this->meridiem['am'] = __( 'am' );
[216] Fix | Delete
$this->meridiem['pm'] = __( 'pm' );
[217] Fix | Delete
$this->meridiem['AM'] = __( 'AM' );
[218] Fix | Delete
$this->meridiem['PM'] = __( 'PM' );
[219] Fix | Delete
[220] Fix | Delete
/*
[221] Fix | Delete
* Numbers formatting.
[222] Fix | Delete
* See https://www.php.net/number_format
[223] Fix | Delete
*/
[224] Fix | Delete
[225] Fix | Delete
/* translators: $thousands_sep argument for https://www.php.net/number_format, default is ',' */
[226] Fix | Delete
$thousands_sep = __( 'number_format_thousands_sep' );
[227] Fix | Delete
[228] Fix | Delete
// Replace space with a non-breaking space to avoid wrapping.
[229] Fix | Delete
$thousands_sep = str_replace( ' ', '&nbsp;', $thousands_sep );
[230] Fix | Delete
[231] Fix | Delete
$this->number_format['thousands_sep'] = ( 'number_format_thousands_sep' === $thousands_sep ) ? ',' : $thousands_sep;
[232] Fix | Delete
[233] Fix | Delete
/* translators: $dec_point argument for https://www.php.net/number_format, default is '.' */
[234] Fix | Delete
$decimal_point = __( 'number_format_decimal_point' );
[235] Fix | Delete
[236] Fix | Delete
$this->number_format['decimal_point'] = ( 'number_format_decimal_point' === $decimal_point ) ? '.' : $decimal_point;
[237] Fix | Delete
[238] Fix | Delete
/* translators: Used between list items, there is a space after the comma. */
[239] Fix | Delete
$this->list_item_separator = __( ', ' );
[240] Fix | Delete
[241] Fix | Delete
// Set text direction.
[242] Fix | Delete
if ( isset( $GLOBALS['text_direction'] ) ) {
[243] Fix | Delete
$this->text_direction = $GLOBALS['text_direction'];
[244] Fix | Delete
[245] Fix | Delete
/* translators: 'rtl' or 'ltr'. This sets the text direction for WordPress. */
[246] Fix | Delete
} elseif ( 'rtl' === _x( 'ltr', 'text direction' ) ) {
[247] Fix | Delete
$this->text_direction = 'rtl';
[248] Fix | Delete
}
[249] Fix | Delete
[250] Fix | Delete
// Set the word count type.
[251] Fix | Delete
$this->word_count_type = $this->get_word_count_type();
[252] Fix | Delete
}
[253] Fix | Delete
[254] Fix | Delete
/**
[255] Fix | Delete
* Retrieves the full translated weekday word.
[256] Fix | Delete
*
[257] Fix | Delete
* Week starts on translated Sunday and can be fetched
[258] Fix | Delete
* by using 0 (zero). So the week starts with 0 (zero)
[259] Fix | Delete
* and ends on Saturday with is fetched by using 6 (six).
[260] Fix | Delete
*
[261] Fix | Delete
* @since 2.1.0
[262] Fix | Delete
*
[263] Fix | Delete
* @param int $weekday_number 0 for Sunday through 6 Saturday.
[264] Fix | Delete
* @return string Full translated weekday.
[265] Fix | Delete
*/
[266] Fix | Delete
public function get_weekday( $weekday_number ) {
[267] Fix | Delete
return $this->weekday[ $weekday_number ];
[268] Fix | Delete
}
[269] Fix | Delete
[270] Fix | Delete
/**
[271] Fix | Delete
* Retrieves the translated weekday initial.
[272] Fix | Delete
*
[273] Fix | Delete
* The weekday initial is retrieved by the translated
[274] Fix | Delete
* full weekday word. When translating the weekday initial
[275] Fix | Delete
* pay attention to make sure that the starting letter does
[276] Fix | Delete
* not conflict.
[277] Fix | Delete
*
[278] Fix | Delete
* @since 2.1.0
[279] Fix | Delete
*
[280] Fix | Delete
* @param string $weekday_name Full translated weekday word.
[281] Fix | Delete
* @return string Translated weekday initial.
[282] Fix | Delete
*/
[283] Fix | Delete
public function get_weekday_initial( $weekday_name ) {
[284] Fix | Delete
return $this->weekday_initial[ $weekday_name ];
[285] Fix | Delete
}
[286] Fix | Delete
[287] Fix | Delete
/**
[288] Fix | Delete
* Retrieves the translated weekday abbreviation.
[289] Fix | Delete
*
[290] Fix | Delete
* The weekday abbreviation is retrieved by the translated
[291] Fix | Delete
* full weekday word.
[292] Fix | Delete
*
[293] Fix | Delete
* @since 2.1.0
[294] Fix | Delete
*
[295] Fix | Delete
* @param string $weekday_name Full translated weekday word.
[296] Fix | Delete
* @return string Translated weekday abbreviation.
[297] Fix | Delete
*/
[298] Fix | Delete
public function get_weekday_abbrev( $weekday_name ) {
[299] Fix | Delete
return $this->weekday_abbrev[ $weekday_name ];
[300] Fix | Delete
}
[301] Fix | Delete
[302] Fix | Delete
/**
[303] Fix | Delete
* Retrieves the full translated month by month number.
[304] Fix | Delete
*
[305] Fix | Delete
* The $month_number parameter has to be a string
[306] Fix | Delete
* because it must have the '0' in front of any number
[307] Fix | Delete
* that is less than 10. Starts from '01' and ends at
[308] Fix | Delete
* '12'.
[309] Fix | Delete
*
[310] Fix | Delete
* You can use an integer instead and it will add the
[311] Fix | Delete
* '0' before the numbers less than 10 for you.
[312] Fix | Delete
*
[313] Fix | Delete
* @since 2.1.0
[314] Fix | Delete
*
[315] Fix | Delete
* @param string|int $month_number '01' through '12'.
[316] Fix | Delete
* @return string Translated full month name. If the month number is not found, an empty string is returned.
[317] Fix | Delete
*/
[318] Fix | Delete
public function get_month( $month_number ) {
[319] Fix | Delete
$month_number = zeroise( $month_number, 2 );
[320] Fix | Delete
if ( ! isset( $this->month[ $month_number ] ) ) {
[321] Fix | Delete
return '';
[322] Fix | Delete
}
[323] Fix | Delete
return $this->month[ $month_number ];
[324] Fix | Delete
}
[325] Fix | Delete
[326] Fix | Delete
/**
[327] Fix | Delete
* Retrieves translated version of month abbreviation string.
[328] Fix | Delete
*
[329] Fix | Delete
* The $month_name parameter is expected to be the translated or
[330] Fix | Delete
* translatable version of the month.
[331] Fix | Delete
*
[332] Fix | Delete
* @since 2.1.0
[333] Fix | Delete
*
[334] Fix | Delete
* @param string $month_name Translated month to get abbreviated version.
[335] Fix | Delete
* @return string Translated abbreviated month.
[336] Fix | Delete
*/
[337] Fix | Delete
public function get_month_abbrev( $month_name ) {
[338] Fix | Delete
return $this->month_abbrev[ $month_name ];
[339] Fix | Delete
}
[340] Fix | Delete
[341] Fix | Delete
/**
[342] Fix | Delete
* Retrieves translated version of month genitive string.
[343] Fix | Delete
*
[344] Fix | Delete
* The $month_number parameter has to be a string
[345] Fix | Delete
* because it must have the '0' in front of any number
[346] Fix | Delete
* that is less than 10. Starts from '01' and ends at
[347] Fix | Delete
* '12'.
[348] Fix | Delete
*
[349] Fix | Delete
* You can use an integer instead and it will add the
[350] Fix | Delete
* '0' before the numbers less than 10 for you.
[351] Fix | Delete
*
[352] Fix | Delete
* @since 6.8.0
[353] Fix | Delete
*
[354] Fix | Delete
* @param string|int $month_number '01' through '12'.
[355] Fix | Delete
* @return string Translated genitive month name.
[356] Fix | Delete
*/
[357] Fix | Delete
public function get_month_genitive( $month_number ) {
[358] Fix | Delete
return $this->month_genitive[ zeroise( $month_number, 2 ) ];
[359] Fix | Delete
}
[360] Fix | Delete
[361] Fix | Delete
/**
[362] Fix | Delete
* Retrieves translated version of meridiem string.
[363] Fix | Delete
*
[364] Fix | Delete
* The $meridiem parameter is expected to not be translated.
[365] Fix | Delete
*
[366] Fix | Delete
* @since 2.1.0
[367] Fix | Delete
*
[368] Fix | Delete
* @param string $meridiem Either 'am', 'pm', 'AM', or 'PM'. Not translated version.
[369] Fix | Delete
* @return string Translated version
[370] Fix | Delete
*/
[371] Fix | Delete
public function get_meridiem( $meridiem ) {
[372] Fix | Delete
return $this->meridiem[ $meridiem ];
[373] Fix | Delete
}
[374] Fix | Delete
[375] Fix | Delete
/**
[376] Fix | Delete
* Global variables are deprecated.
[377] Fix | Delete
*
[378] Fix | Delete
* For backward compatibility only.
[379] Fix | Delete
*
[380] Fix | Delete
* @since 2.1.0
[381] Fix | Delete
* @deprecated For backward compatibility only.
[382] Fix | Delete
*
[383] Fix | Delete
* @global array $weekday
[384] Fix | Delete
* @global array $weekday_initial
[385] Fix | Delete
* @global array $weekday_abbrev
[386] Fix | Delete
* @global array $month
[387] Fix | Delete
* @global array $month_abbrev
[388] Fix | Delete
*/
[389] Fix | Delete
public function register_globals() {
[390] Fix | Delete
$GLOBALS['weekday'] = $this->weekday;
[391] Fix | Delete
$GLOBALS['weekday_initial'] = $this->weekday_initial;
[392] Fix | Delete
$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;
[393] Fix | Delete
$GLOBALS['month'] = $this->month;
[394] Fix | Delete
$GLOBALS['month_abbrev'] = $this->month_abbrev;
[395] Fix | Delete
}
[396] Fix | Delete
[397] Fix | Delete
/**
[398] Fix | Delete
* Checks if current locale is RTL.
[399] Fix | Delete
*
[400] Fix | Delete
* @since 3.0.0
[401] Fix | Delete
* @return bool Whether locale is RTL.
[402] Fix | Delete
*/
[403] Fix | Delete
public function is_rtl() {
[404] Fix | Delete
return 'rtl' === $this->text_direction;
[405] Fix | Delete
}
[406] Fix | Delete
[407] Fix | Delete
/**
[408] Fix | Delete
* Registers date/time format strings for general POT.
[409] Fix | Delete
*
[410] Fix | Delete
* Private, unused method to add some date/time formats translated
[411] Fix | Delete
* on wp-admin/options-general.php to the general POT that would
[412] Fix | Delete
* otherwise be added to the admin POT.
[413] Fix | Delete
*
[414] Fix | Delete
* @since 3.6.0
[415] Fix | Delete
*/
[416] Fix | Delete
public function _strings_for_pot() {
[417] Fix | Delete
/* translators: Localized date format, see https://www.php.net/manual/datetime.format.php */
[418] Fix | Delete
__( 'F j, Y' );
[419] Fix | Delete
/* translators: Localized time format, see https://www.php.net/manual/datetime.format.php */
[420] Fix | Delete
__( 'g:i a' );
[421] Fix | Delete
/* translators: Localized date and time format, see https://www.php.net/manual/datetime.format.php */
[422] Fix | Delete
__( 'F j, Y g:i a' );
[423] Fix | Delete
}
[424] Fix | Delete
[425] Fix | Delete
/**
[426] Fix | Delete
* Retrieves the localized list item separator.
[427] Fix | Delete
*
[428] Fix | Delete
* @since 6.0.0
[429] Fix | Delete
*
[430] Fix | Delete
* @return string Localized list item separator.
[431] Fix | Delete
*/
[432] Fix | Delete
public function get_list_item_separator() {
[433] Fix | Delete
return $this->list_item_separator;
[434] Fix | Delete
}
[435] Fix | Delete
[436] Fix | Delete
/**
[437] Fix | Delete
* Retrieves the localized word count type.
[438] Fix | Delete
*
[439] Fix | Delete
* @since 6.2.0
[440] Fix | Delete
*
[441] Fix | Delete
* @return string Localized word count type. Possible values are `characters_excluding_spaces`,
[442] Fix | Delete
* `characters_including_spaces`, or `words`. Defaults to `words`.
[443] Fix | Delete
*/
[444] Fix | Delete
public function get_word_count_type() {
[445] Fix | Delete
[446] Fix | Delete
/*
[447] Fix | Delete
* translators: If your word count is based on single characters (e.g. East Asian characters),
[448] Fix | Delete
* enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
[449] Fix | Delete
* Do not translate into your own language.
[450] Fix | Delete
*/
[451] Fix | Delete
$word_count_type = is_null( $this->word_count_type ) ? _x( 'words', 'Word count type. Do not translate!' ) : $this->word_count_type;
[452] Fix | Delete
[453] Fix | Delete
// Check for valid types.
[454] Fix | Delete
if ( 'characters_excluding_spaces' !== $word_count_type && 'characters_including_spaces' !== $word_count_type ) {
[455] Fix | Delete
// Defaults to 'words'.
[456] Fix | Delete
$word_count_type = 'words';
[457] Fix | Delete
}
[458] Fix | Delete
[459] Fix | Delete
return $word_count_type;
[460] Fix | Delete
}
[461] Fix | Delete
}
[462] Fix | Delete
[463] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function