Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#36790 closed defect (bug) (fixed)

Wrong month name declension

Reported by: pavelevap's profile pavelevap Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.6 Priority: normal
Severity: normal Version: 4.4
Component: I18N Keywords: needs-unit-tests
Focuses: Cc:

Description

Previously #11226.

Czech month names:

June - Červen - června (declension)
July - Červenec - července (declension)

When I use j. F Y date format, website displays for example 10/7/2015 as 10. červnaec 2015 instead of 10. července 2015.

You can try to Google červnaec, there are many results for this wrong declension.

Attachments (3)

Snímek obrazovky 2016-06-05 v 22.44.18.png (158.3 KB) - added by semil 8 years ago.
36790.skip-tests.patch (1.0 KB) - added by ocean90 8 years ago.
36790.patch (1000 bytes) - added by SergeyBiryukov 8 years ago.

Download all attachments as: .zip

Change History (16)

#2 @SergeyBiryukov
8 years ago

  • Owner set to SergeyBiryukov
  • Status changed from new to assigned

#3 @pavelevap
8 years ago

@SergeyBiryukov: Hi, there are many reports related to this problem and July is slowly coming :-( All websites with particular date format are affected in our language. Should I create plugin for filtering date or localization cs_CZ.php file?

#4 @ocean90
8 years ago

#36986 was marked as a duplicate.

#5 @ocean90
8 years ago

#37034 was marked as a duplicate.

#6 @ocean90
8 years ago

  • Keywords needs-patch needs-unit-tests added
  • Milestone changed from Awaiting Review to 4.6
  • Owner SergeyBiryukov deleted
  • Status changed from assigned to reviewing

#7 @semil
8 years ago

Hi everyone,

I would like to notice bug in function wp_maybe_decline_date for preg_replace pattern.
In our czech language we have 2 months with similar root word so it detects previous month and replace this root word.
Solutions is update pattern for preg_replace from

'#' . $month . '#'

to

'/\b' . $month . '\b/u'

Best regards,
Jan

#8 @SergeyBiryukov
8 years ago

In 37716:

I18N: Add a unit test for wp_maybe_decline_date().

See #36790.

#9 @SergeyBiryukov
8 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from reviewing to closed

In 37717:

I18N: Adjust the regex in wp_maybe_decline_date() to handle word boundaries correctly.

Props semil.
Fixes #36790.

#10 @SergeyBiryukov
8 years ago

In 37718:

I18N: Revert the test added in [37716], as it causes errors when running the full suite.

See #36790.

#11 @SergeyBiryukov
8 years ago

  • Keywords needs-patch removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

#12 @ocean90
8 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 37975:

I18N: Add tests for wp_maybe_decline_date().

Reverts [37718], $wp_locale needs to be cloned.

Props SergeyBiryukov.
Fixes #36790.

#13 @SergeyBiryukov
8 years ago

In 37979:

I18N: Adjust the regex in wp_maybe_decline_date() to avoid \w and \b, as they don't work with Unicode characters correctly in PHP 5.3.3 and earlier versions.

See [37975] for unit tests.

See #36790.

Note: See TracTickets for help on using tickets.