WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 5 weeks ago

#36259 assigned defect (bug)

Switching language should update date and time formats

Reported by: SergeyBiryukov Owned by: vagios
Milestone: 5.0 Priority: normal
Severity: normal Version:
Component: I18N Keywords: needs-refresh good-first-bug has-patch
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Previously: #11226

  1. Install WordPress in English.
  2. Switch language to Russian.
  3. Date and time formats in General Settings are still F j, Y and g:i a, which doesn't make sense for Russian and doesn't match the locale defaults (d.m.Y and H:i, respectively).

Attachments (1)

36259.patch (1.8 KB) - added by vagios 2 years ago.

Download all attachments as: .zip

Change History (11)

#1 @Clorith
2 years ago

This would need to account for those who have set their own date and time formats though, so as not to override user settings that may differ from what we expect from a locale.

#2 @swissspidy
2 years ago

This would need to account for those who have set their own date and time formats though, so as not to override user settings that may differ from what we expect from a locale.

It could work by not saving the date and time formats to the database until they differ from the ones specified by the locale.

This ticket was mentioned in Slack in #core-i18n by ocean90. View the logs.


2 years ago

#4 @SergeyBiryukov
2 years ago

  • Description modified (diff)

#5 @ocean90
2 years ago

  • Keywords needs-refresh good-first-bug added
  • Milestone changed from Awaiting Review to Future Release

@vagios
2 years ago

#6 follow-up: @vagios
2 years ago

  • Keywords has-patch added

In 36259.patch, if the locale's default date/time format is used, after the update the new locale's default values will be used. In any other case the code works as before.

#7 @DrewAPicture
2 years ago

Related-ish: #28344

#8 in reply to: ↑ 6 @only1andrewh
2 years ago

Replying to vagios:

In 36259.patch, if the locale's default date/time format is used, after the update the new locale's default values will be used. In any other case the code works as before.

I just tested this patch, and if left on the default time format it changes to the one specific to the chosen country. Before applying the patch I confirmed that the old local was going into the custom format and active.

#9 @DrewAPicture
13 months ago

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

Assigning ownership to mark the good-first-bug as "claimed".

#10 @SergeyBiryukov
5 weeks ago

  • Milestone changed from Future Release to 5.0
Note: See TracTickets for help on using tickets.