15 var $text_direction = 'ltr';
16 var $locale_vars = array('text_direction');
20 $this->weekday[0] = __('Sunday');
21 $this->weekday[1] = __('Monday');
22 $this->weekday[2] = __('Tuesday');
23 $this->weekday[3] = __('Wednesday');
24 $this->weekday[4] = __('Thursday');
25 $this->weekday[5] = __('Friday');
26 $this->weekday[6] = __('Saturday');
28 // The first letter of each day. The _%day%_initial suffix is a hack to make
29 // sure the day initials are unique.
30 $this->weekday_initial[__('Sunday')] = __('S_Sunday_initial');
31 $this->weekday_initial[__('Monday')] = __('M_Monday_initial');
32 $this->weekday_initial[__('Tuesday')] = __('T_Tuesday_initial');
33 $this->weekday_initial[__('Wednesday')] = __('W_Wednesday_initial');
34 $this->weekday_initial[__('Thursday')] = __('T_Thursday_initial');
35 $this->weekday_initial[__('Friday')] = __('F_Friday_initial');
36 $this->weekday_initial[__('Saturday')] = __('S_Saturday_initial');
38 foreach ($this->weekday_initial as $weekday_ => $weekday_initial_) {
39 $this->weekday_initial[$weekday_] = preg_replace('/_.+_initial$/', '', $weekday_initial_);
42 // Abbreviations for each day.
43 $this->weekday_abbrev[__('Sunday')] = __('Sun');
44 $this->weekday_abbrev[__('Monday')] = __('Mon');
45 $this->weekday_abbrev[__('Tuesday')] = __('Tue');
46 $this->weekday_abbrev[__('Wednesday')] = __('Wed');
47 $this->weekday_abbrev[__('Thursday')] = __('Thu');
48 $this->weekday_abbrev[__('Friday')] = __('Fri');
49 $this->weekday_abbrev[__('Saturday')] = __('Sat');
52 $this->month['01'] = __('January');
53 $this->month['02'] = __('February');
54 $this->month['03'] = __('March');
55 $this->month['04'] = __('April');
56 $this->month['05'] = __('May');
57 $this->month['06'] = __('June');
58 $this->month['07'] = __('July');
59 $this->month['08'] = __('August');
60 $this->month['09'] = __('September');
61 $this->month['10'] = __('October');
62 $this->month['11'] = __('November');
63 $this->month['12'] = __('December');
65 // Abbreviations for each month. Uses the same hack as above to get around the
67 $this->month_abbrev[__('January')] = __('Jan_January_abbreviation');
68 $this->month_abbrev[__('February')] = __('Feb_February_abbreviation');
69 $this->month_abbrev[__('March')] = __('Mar_March_abbreviation');
70 $this->month_abbrev[__('April')] = __('Apr_April_abbreviation');
71 $this->month_abbrev[__('May')] = __('May_May_abbreviation');
72 $this->month_abbrev[__('June')] = __('Jun_June_abbreviation');
73 $this->month_abbrev[__('July')] = __('Jul_July_abbreviation');
74 $this->month_abbrev[__('August')] = __('Aug_August_abbreviation');
75 $this->month_abbrev[__('September')] = __('Sep_September_abbreviation');
76 $this->month_abbrev[__('October')] = __('Oct_October_abbreviation');
77 $this->month_abbrev[__('November')] = __('Nov_November_abbreviation');
78 $this->month_abbrev[__('December')] = __('Dec_December_abbreviation');
80 foreach ($this->month_abbrev as $month_ => $month_abbrev_) {
81 $this->month_abbrev[$month_] = preg_replace('/_.+_abbreviation$/', '', $month_abbrev_);
85 $this->meridiem['am'] = __('am');
86 $this->meridiem['pm'] = __('pm');
87 $this->meridiem['AM'] = __('AM');
88 $this->meridiem['PM'] = __('PM');
91 // See http://php.net/number_format
93 $trans = _c('number_format_decimals|$decimals argument for http://php.net/number_format, default is 0');
94 $this->number_format['decimals'] = ('number_format_decimals' == $trans) ? 0 : $trans;
96 $trans = _c('number_format_decimal_point|$dec_point argument for http://php.net/number_format, default is .');
97 $this->number_format['decimal_point'] = ('number_format_decimal_point' == $trans) ? '.' : $trans;
99 $trans = _c('number_format_thousands_sep|$thousands_sep argument for http://php.net/number_format, default is ,');
100 $this->number_format['thousands_sep'] = ('number_format_thousands_sep' == $trans) ? ',' : $trans;
102 // Import global locale vars set during inclusion of $locale.php.
103 foreach ( $this->locale_vars as $var ) {
104 if ( isset($GLOBALS[$var]) )
105 $this->$var = $GLOBALS[$var];
110 function get_weekday($weekday_number) {
111 return $this->weekday[$weekday_number];
114 function get_weekday_initial($weekday_name) {
115 return $this->weekday_initial[$weekday_name];
118 function get_weekday_abbrev($weekday_name) {
119 return $this->weekday_abbrev[$weekday_name];
122 function get_month($month_number) {
123 return $this->month[zeroise($month_number, 2)];
126 function get_month_initial($month_name) {
127 return $this->month_initial[$month_name];
130 function get_month_abbrev($month_name) {
131 return $this->month_abbrev[$month_name];
134 function get_meridiem($meridiem) {
135 return $this->meridiem[$meridiem];
138 // Global variables are deprecated. For backwards compatibility only.
139 function register_globals() {
140 $GLOBALS['weekday'] = $this->weekday;
141 $GLOBALS['weekday_initial'] = $this->weekday_initial;
142 $GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;
143 $GLOBALS['month'] = $this->month;
144 $GLOBALS['month_abbrev'] = $this->month_abbrev;
147 function WP_Locale() {
149 $this->register_globals();