Changeset 35517
- Timestamp:
- 11/04/2015 09:27:41 PM (9 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/default-filters.php
r35466 r35517 159 159 160 160 add_filter( 'widget_text', 'balanceTags' ); 161 162 add_filter( 'date_i18n', 'wp_maybe_decline_date' ); 161 163 162 164 // RSS filters -
trunk/src/wp-includes/functions.php
r35494 r35517 157 157 $j = apply_filters( 'date_i18n', $j, $req_format, $i, $gmt ); 158 158 return $j; 159 } 160 161 /** 162 * Determines if the date should be declined. 163 * 164 * If the locale specifies that month names require a genitive case in certain 165 * formats (like 'j F Y'), the month name will be replaced with a correct form. 166 * 167 * @since 4.4.0 168 * 169 * @param string $date Formatted date string. 170 * @return string The date, declined if locale specifies it. 171 */ 172 function wp_maybe_decline_date( $date ) { 173 global $wp_locale; 174 175 /* translators: If months in your language require a genitive case, 176 * translate this to 'on'. Do not translate into your own language. 177 */ 178 if ( 'on' === _x( 'off', 'decline months names: on or off' ) ) { 179 // Match a format like 'j F Y' or 'j. F' 180 if ( @preg_match( '#^\d{1,2}\.? \w+#u', $date ) ) { 181 $months = $wp_locale->month; 182 183 foreach ( $months as $key => $month ) { 184 $months[ $key ] = '#' . $month . '#'; 185 } 186 187 $date = preg_replace( $months, $wp_locale->month_genitive, $date ); 188 } 189 } 190 191 // Used for locale-specific rules 192 $locale = get_locale(); 193 194 if ( 'ca' === $locale ) { 195 // " de abril| de agost| de octubre..." -> " d'abril| d'agost| d'octubre..." 196 $date = preg_replace( '# de ([ao])#i', " d'\\1", $date ); 197 } 198 199 return $date; 159 200 } 160 201 -
trunk/src/wp-includes/locale.php
r35372 r35517 140 140 141 141 // The Months 142 $this->month['01'] = /* translators: month name */ __('January'); 143 $this->month['02'] = /* translators: month name */ __('February'); 144 $this->month['03'] = /* translators: month name */ __('March'); 145 $this->month['04'] = /* translators: month name */ __('April'); 146 $this->month['05'] = /* translators: month name */ __('May'); 147 $this->month['06'] = /* translators: month name */ __('June'); 148 $this->month['07'] = /* translators: month name */ __('July'); 149 $this->month['08'] = /* translators: month name */ __('August'); 150 $this->month['09'] = /* translators: month name */ __('September'); 151 $this->month['10'] = /* translators: month name */ __('October'); 152 $this->month['11'] = /* translators: month name */ __('November'); 153 $this->month['12'] = /* translators: month name */ __('December'); 142 $this->month['01'] = /* translators: month name */ __( 'January' ); 143 $this->month['02'] = /* translators: month name */ __( 'February' ); 144 $this->month['03'] = /* translators: month name */ __( 'March' ); 145 $this->month['04'] = /* translators: month name */ __( 'April' ); 146 $this->month['05'] = /* translators: month name */ __( 'May' ); 147 $this->month['06'] = /* translators: month name */ __( 'June' ); 148 $this->month['07'] = /* translators: month name */ __( 'July' ); 149 $this->month['08'] = /* translators: month name */ __( 'August' ); 150 $this->month['09'] = /* translators: month name */ __( 'September' ); 151 $this->month['10'] = /* translators: month name */ __( 'October' ); 152 $this->month['11'] = /* translators: month name */ __( 'November' ); 153 $this->month['12'] = /* translators: month name */ __( 'December' ); 154 155 // The Months, genitive 156 $this->month_genitive['01'] = /* translators: month name, genitive */ _x( 'January', 'genitive' ); 157 $this->month_genitive['02'] = /* translators: month name, genitive */ _x( 'February', 'genitive' ); 158 $this->month_genitive['03'] = /* translators: month name, genitive */ _x( 'March', 'genitive' ); 159 $this->month_genitive['04'] = /* translators: month name, genitive */ _x( 'April', 'genitive' ); 160 $this->month_genitive['05'] = /* translators: month name, genitive */ _x( 'May', 'genitive' ); 161 $this->month_genitive['06'] = /* translators: month name, genitive */ _x( 'June', 'genitive' ); 162 $this->month_genitive['07'] = /* translators: month name, genitive */ _x( 'July', 'genitive' ); 163 $this->month_genitive['08'] = /* translators: month name, genitive */ _x( 'August', 'genitive' ); 164 $this->month_genitive['09'] = /* translators: month name, genitive */ _x( 'September', 'genitive' ); 165 $this->month_genitive['10'] = /* translators: month name, genitive */ _x( 'October', 'genitive' ); 166 $this->month_genitive['11'] = /* translators: month name, genitive */ _x( 'November', 'genitive' ); 167 $this->month_genitive['12'] = /* translators: month name, genitive */ _x( 'December', 'genitive' ); 154 168 155 169 // Abbreviations for each month.
Note: See TracChangeset
for help on using the changeset viewer.