Open Bug 1739712 Opened 3 years ago Updated 2 months ago

Wrong input date formatting for UK English

Categories

(Core :: Internationalization, enhancement, P5)

Firefox 94
enhancement

Tracking

()

UNCONFIRMED

People

(Reporter: svoop_is3o9g35si, Unassigned)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:94.0) Gecko/20100101 Firefox/94.0

Steps to reproduce:

Both <input type="datetime-local"> and <input type="date"> display dates as MM/DD/YYYY when the browser language "English (United Kingdom)" is installed and active. However, UK dates should be DD/MM/YYYY.

Furthermore, <input type="datetime-local"> uses 12h AM/PM notation for time which is allowed in the UK, but not nearly as common as 24h notation.

Actual results:

  • Install "English (United Kingdom)" language
  • Activate language and restart browser
  • Access page containing datetime-local and date inputs
  • Got "MM/DD/YYYY HH:MM:SS AM/PM" displayed in input

Expected results:

Should get "DD/MM/YYYY HH:MM:SS" displayed in input

The Bugbug bot thinks this bug should belong to the 'Core::Internationalization' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Internationalization
Product: Firefox → Core

Hi Sven,

Thank you for the report. Can you share the Internationalization section of your about:support page?

Flags: needinfo?(svoop)
Flags: needinfo?(svoop)

Hi Zibi

Since the support info shows the OS using en-US rather than en-GB, I've switched that locale on the OS level as well... and hey, the datetimes are formatted just fine as "DD/MM/YYYY HH:MM:SS". I didn't know Firefox actually cared about the OS locales at all.

So maybe this is not so much of a bug, but rather a question of documentation or adding some explanation to the languages prefs sections of Firefox?

Ah, that's so interesting.

The history of this feature is amusing and enlightning!

Originally we were not using OS locales because we have a number of users who want/need there to be a separation between a locale they use in OS and for Firefox.

Then, we had a group of users who did want Firefox to follow the OS locale, so we switched it.

Then, we had a group of users who reported confusion because their Firefox was in German, their Windows in American English and they saw American English month names in German sentences in Firefox...

Soo, we devised this slightly sophisticated system where if the language portion of your OS locale matches langauge portion of Firefox locale (for example "en-US" and "en-GB"), then we will use the region portfion of your OS locale in Firefox.

That guaranteed that by default German and English won't get mixed, while OS regional setting carries over into Firefox.

And you are the first user I encountered who was confused by that behavior because you expected Firefox to ignore OS settings since you explicitly told Firefox to use British regionnal settings :)

That's a good reminder that:
a) People are opinionated about their expectation out of regional prefs
b) There is an infinite matrix of preferences

We even have a setting to override the current state and allow you to have your languages mixed, but not the other way around!

It's all documented here: https://firefox-source-docs.mozilla.org/intl/locale.html#regional-preferences

If you needed, we could add a pref to allow you to force Firefox to not match on OS region ever, but from your last comment I assume you're ok with it, was just surprised :)

I'm not sure if that's actionable - extending Firefox Preferences UI to in detail talk about the possible combinations seems quite heavy handed solution, but maybe one day we'll have to?

(In reply to Zibi Braniecki [:zbraniecki][:gandalf] from comment #5)

If you needed, we could add a pref to allow you to force Firefox to not match on OS region ever, but from your last comment I assume you're ok with it, was just surprised :)

I think that's covered by the one we added in bug 1379910?

It is not. That pref allows you to decide between "follow os locale always" and "follow only if language matches". What is missing is Sven original expectation "do not follow ever"

What is missing is Sven original expectation "do not follow ever"

Funny feature story, indeed. :-) Without this context in mind though and just looking at the UI, my expectation is not very far fetched: You can set OS-wide locales and almost the same interface is duplicated in an individual app, so it must mask whatever I have set OS-wide. After all, that's how many apps on Android work.

Soo, we devised this slightly sophisticated system where if the language portion of your OS locale matches langauge portion of Firefox locale (for example "en-US" and "en-GB"), then we will use the region portfion of your OS locale in Firefox.
That guaranteed that by default German and English won't get mixed, while OS regional setting carries over into Firefox.

Say, you have only "en-UK" installed in Firefox and the OS is set to "en-US". According to the description above, Firefox should use the region portion from the OS, but that locale is not installed in Firefox. What happens now?

I'm not sure if that's actionable - extending Firefox Preferences UI to in detail talk about the possible combinations seems quite heavy handed solution, but maybe one day we'll have to?

Probably not... then again, I came across this problem because working on a project, I switched from old school text-inputs plus JS-foo to native date-/datetime-inputs. It might become more of an issue if/when these native inputs gain more popularity. Maybe something simple could help one day, like: In case the sophisticated magic kicks in (same country but different region portions in OS and Firefox), a little warning à la "OS language setting en-US takes precedence" is displayed.

Say, you have only "en-UK" installed in Firefox and the OS is set to "en-US". According to the description above, Firefox should use the region portion from the OS, but that locale is not installed in Firefox. What happens now?

Your localization resources (strings, messages etc.) will be in en-US, but your dates, times etc. will be in en-GB.

In case the sophisticated magic kicks in (same country but different region portions in OS and Firefox), a little warning à la "OS language setting en-US takes precedence" is displayed.

That's a good idea. I'm going to keep it as low priority but keep it open in case we start seeing more people bringing it up.
If that happens we'll reach out to UX team to discuss what we can do about it and maybe such a conditional note will help others!

Severity: -- → S4
Type: defect → enhancement
Priority: -- → P5
See Also: → 1803564, 1843253
See Also: → 1881690
See Also: → 1888968
See Also: → 1902653
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: