IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
219 | 219 | * translate this to 'on'. Do not translate into your own language. |
220 | 220 | */ |
221 | 221 | if ( 'on' === _x( 'off', 'decline months names: on or off' ) ) { |
222 | | // Match a format like 'j F Y' or 'j. F' |
223 | | if ( @preg_match( '#^\d{1,2}\.? [^\d ]+#u', $date ) ) { |
224 | | $months = $wp_locale->month; |
225 | | $months_genitive = $wp_locale->month_genitive; |
| 222 | |
| 223 | $months = $wp_locale->month; |
| 224 | $months_genitive = $wp_locale->month_genitive; |
226 | 225 | |
| 226 | // Match a format like 'j F Y' or 'j. F' |
| 227 | if ( @preg_match( '#^\d{1,2}\.? [^\d ]+#u', $date ) ) { |
| 228 | |
227 | 229 | foreach ( $months as $key => $month ) { |
228 | 230 | $months[ $key ] = '# ' . $month . '( |$)#u'; |
229 | 231 | } |
… |
… |
|
232 | 234 | $months_genitive[ $key ] = ' ' . $month . '$1'; |
233 | 235 | } |
234 | 236 | |
| 237 | $date = preg_replace( $months, $months_genitive, $date ); |
| 238 | } |
| 239 | |
| 240 | // Match a format like 'F jS' or 'F j' and change it to 'j F' |
| 241 | if ( @preg_match( '#^[^\d ]+ \d{1,2}(st|nd|rd|th)? #u', trim( $date ) ) ) { |
| 242 | foreach ( $months as $key => $month ) { |
| 243 | $months[ $key ] = '#' . $month . ' (\d{1,2})(st|nd|rd|th)?#u'; |
| 244 | } |
| 245 | |
| 246 | foreach ( $months_genitive as $key => $month ) { |
| 247 | $months_genitive[ $key ] = '$1 ' . $month; |
| 248 | } |
| 249 | |
235 | 250 | $date = preg_replace( $months, $months_genitive, $date ); |
236 | 251 | } |
237 | 252 | } |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
3 | 3 | /** |
4 | 4 | * @group functions.php |
5 | 5 | * @group i18n |
| 6 | * @group datetime |
6 | 7 | */ |
7 | 8 | class Tests_Functions_MaybeDeclineDate extends WP_UnitTestCase { |
8 | 9 | |
… |
… |
|
68 | 69 | return array( |
69 | 70 | array( 'ru_RU', '21 Июнь', '21 июня' ), |
70 | 71 | array( 'ru_RU', '1 Январь 2016', '1 января 2016' ), |
| 72 | array( 'ru_RU', 'Январь 1st 2016', '1 января 2016' ), |
| 73 | array( 'ru_RU', 'Январь 1 2016', '1 января 2016' ), |
71 | 74 | array( 'pl_PL', '1 Styczeń', '1 stycznia' ), |
72 | 75 | array( 'hr', '1. Siječanj', '1. siječnja' ), |
73 | 76 | array( 'ca', '1 de abril', "1 d'abril" ), |