Ticket #37411: 37411.patch
File 37411.patch, 1.4 KB (added by , 9 years ago) |
---|
-
src/wp-includes/functions.php
181 181 * translate this to 'on'. Do not translate into your own language. 182 182 */ 183 183 if ( 'on' === _x( 'off', 'decline months names: on or off' ) ) { 184 $months = $wp_locale->month; 185 $months_genitive = $wp_locale->month_genitive; 186 184 187 // Match a format like 'j F Y' or 'j. F' 185 if ( @preg_match( '#^\d{1,2}\.? [^\d ]+#u', $date ) ) { 186 $months = $wp_locale->month; 187 $months_genitive = $wp_locale->month_genitive; 188 188 if ( @preg_match( '#^\d{1,2}\.? [^\d ]+#u', trim( $date ) ) ) { 189 189 foreach ( $months as $key => $month ) { 190 190 $months[ $key ] = '# ' . $month . '( |$)#u'; 191 191 } … … 196 196 197 197 $date = preg_replace( $months, $months_genitive, $date ); 198 198 } 199 200 // Match a format like 'F jS' or 'F j' and change it to 'j F' 201 if ( @preg_match( '#^[^\d ]+ \d{1,2}(st|nd|rd|th)? #u', trim( $date ) ) ) { 202 foreach ( $months as $key => $month ) { 203 $months[ $key ] = '#' . $month . ' (\d{1,2})(st|nd|rd|th)?#u'; 204 } 205 206 foreach ( $months_genitive as $key => $month ) { 207 $months_genitive[ $key ] = '$1 ' . $month; 208 } 209 210 $date = preg_replace( $months, $months_genitive, $date ); 211 } 199 212 } 200 213 201 214 // Used for locale-specific rules