Make WordPress Core

Opened 4 weeks ago

Last modified 2 days ago

#64102 reopened enhancement

add label to date/time to show which string is the language default

Reported by: pbearne's profile pbearne Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 7.0 Priority: normal
Severity: normal Version:
Component: Date/Time Keywords: needs-patch
Focuses: Cc:

Description

there is no indication what is the language default format is

Change History (14)

This ticket was mentioned in PR #10289 on WordPress/wordpress-develop by @pbearne.


4 weeks ago
#1

  • Keywords has-patch added

#2 @SergeyBiryukov
4 weeks ago

  • Milestone changed from Awaiting Review to 6.9
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#3 @SergeyBiryukov
4 weeks ago

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

In 60942:

Date/Time: Add indication of site language default date/time format in General Settings.

This aims to make it easier to determine which format is the default for the current locale.

Props pbearne, SergeyBiryukov.
Fixes #64102.

#4 @swissspidy
4 weeks ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

@SergeyBiryukov @pbearne won't __( 'F j, Y' ) and __( 'g:i a' ) actually be displayed in the user locale though? So saying it's the site language default is incorrect. Unless I'm missing something, we'd need to switch locales first.

#5 follow-up: @johnbillion
4 weeks ago

  • Keywords 2nd-opinion added

What is the underlying intention of this change?

This doesn't appear to be compatible with RTL languages. It's concatenating two localised strings together.

#6 in reply to: ↑ 5 @SergeyBiryukov
4 weeks ago

Replying to swissspidy:

won't __( 'F j, Y' ) and __( 'g:i a' ) actually be displayed in the user locale though? So saying it's the site language default is incorrect. Unless I'm missing something, we'd need to switch locales first.

Good point, thanks!

Replying to johnbillion:

What is the underlying intention of this change?

I thought it might be beneficial to see which value is the default date/time format for the locale, but I missed that site locale might be different from the user's locale.

Perhaps the label could be just "Language default" to keep things simple? Otherwise, this can be reverted for now.

This doesn't appear to be compatible with RTL languages. It's concatenating two localised strings together.

As far as I can tell, that should not be an issue for RTL languages. There are many other instances where we concatenate localized strings together, including help text on that very screen, or constructing $pending_admin_email_message. Text direction would then take care of proper display, as noted in #47655, #55081, etc.

#7 @pbearne
3 weeks ago

In #36259 we are trying to fix that so this shows the site lang on these dropdowns not the user

Last edited 2 weeks ago by SergeyBiryukov (previous) (diff)

#8 @swissspidy
13 days ago

  • Keywords needs-patch added; has-patch 2nd-opinion removed

#9 @desrosj
9 days ago

The main question that came up in #36259 that needs confirmation is whether the date_format/time_format options should render for the user's preference or the site's selected locale.

I believe that it should be the site's locale because this option sets the global default for the site. But currently the options are shown based on the user's selected locale.

That aside, the thinking behind this suggestion itself is that when a user's selected locale differs from the site, a (Site Default) label would make it obvious to the user which date format is the preferred default for the site's selected locale.

But that would require the F j, Y/g:i a formats to be translated into both the site and user locales.

I'm thinking let's revert this for 6.9 and we can try to fix this properly in 7.0 along with #36259 and any other Date Format related issues for the General Settings page.

This ticket was mentioned in Slack in #core by wildworks. View the logs.


3 days ago

#11 @wildworks
3 days ago

This ticket was brought up in today's 6.9 bug scrub.

I'm thinking let's revert this for 6.9 and we can try to fix this properly in 7.0 along with #36259 and any other Date Format related issues for the General Settings page.

@SergeyBiryukov @desrosj, Is it possible to do this before RC1?

#12 @desrosj
2 days ago

In 61193:

Date/Time: Revert [60942].

The changes in [60942] aimed to add an indicator next to the default date and time formats for the site’s locale in General Settings. However, the changes do not take into account the fact that a user may have a different language than the site’s default selected as their preference.

Props swissspidy, johnbillion, SergeyBiryukov, pbearne, desrosj, wildworks.
See #64102.

#13 @desrosj
2 days ago

  • Milestone changed from 6.9 to 7.0

I've gone and reverted [60942]. Let's try again in 7.0.

#14 @desrosj
2 days ago

  • Type changed from defect (bug) to enhancement

Also, reclassifying as an enhancement since this aims to add additional context and not to fix something that's broken.

Note: See TracTickets for help on using tickets.