Open Bug 1881690 Opened 2 years ago Updated 1 month ago

Firefox does not use system locale preferences

Categories

(Core :: Internationalization, defect, P3)

Firefox 124
defect

Tracking

()

UNCONFIRMED

People

(Reporter: Ceremony, Unassigned)

References

Details

Attachments

(2 files)

Attached image Firefox Settings.png

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0

Steps to reproduce:

  • Match language of OS (in my case Windows 11 & en_US) and Firefox (en_US)
  • Set a non default locale in the OS, such as a custom format or a predefined set of another language (in my case de_DE).
  • Make sure "Resist Fingerprinting" is disabled (privacy.fingerprintingProtection & privacy.resistFingerprinting) as this may negatively impact the results

Actual results:

Firefox does not adopt the locale preferences and sticks to its own language preferences.
In my case, the date 2024-02-23 in a <input type="date"> is still shown as 02/23/2024
Same en_US format is used when using toLocaleDateString on a Date object.

Expected results:

According to https://searchfox.org/mozilla-central/source/intl/docs/locale.rst#385, FireFox should use the locale preferences of the system when language of both FireFox and OS (partially) match. Thus the date 2024-02-23 should be shown as 23.02.2024 when the locale is set to German.

Apparently, this is no longer the case.

The correct behavior can only be achieved when setting intl.regional_prefs.use_os_locales to true. This option is also not exposed in the UI settings and only shows up while the mentioned setting is set to true. once unchecked, it disappears. Another bug? For this, see also https://bugzilla.mozilla.org/show_bug.cgi?id=1684602

Here is a small test to test how firefox renders the <input type="date"> and <input type="datetime-local"> elements, as well as how Intl.DateTimeFormat interprets these dates (toLocaleDateString&& toLocaleString)

Can you please use https://mozilla.github.io/mozregression/ to figure out when this changed? (Assuming it actually did behave differently before)

Flags: needinfo?(david+bugzilla)

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

Component: Untriaged → Internationalization
Product: Firefox → Core

I believe it has never worked. I am running firefox since version 3.x or so and am running the OS in en_US with german as my locale and can't remember it ever working as described... I checked out various versions of firefox using the mozregression tool and couldn't find any that actually worked and adopted OS locale automatically without setting intl.regional_prefs.use_os_locales.

I was able to pinpoint the introduction of intl.regional_prefs.use_os_locales to build 2017-07-12 tho

Flags: needinfo?(david+bugzilla)

I am somewhat confused on the steps to reproduce and expectations. Firefox will not match the language of the OS, but it should use the OS preference for date/time.

Here's my expectation of how the code should work without refreshing my memory by reading the current implementation:

  • In an "en" OS and "en" browser, the customized date/time format from the OS should be used.
  • In a "de" OS and "en" browser, the defaults for the date/time should be used in Firefox.

Is it possible to customize the date/time per-locale on Windows? I would assume not.

Can you elaborate which case you are expecting to work?

Flags: needinfo?(david+bugzilla)

Yes Greg, your description matches the behavior mentioned in locale.rst and it is what Firefox should do, yet doesn't and seems to stick to the language defaults of firefox variant that is installed, no matter how identical OS and FireFox language is. The OS has no impact on the language of firefox.

As for locale: In windows, locale is not locked to a language, so you can mix and match language and locale and even define and customize locale to a degree (https://i.imgur.com/yUp2T4D.png).

Here's a quick summary of my specific case:

  • OS: Windows 11 (also tested 10)
  • OS language: en_US
  • OS locale: de_DE
  • Firefox language: en_US
  • Resulting locale in Firefox: en_US
  • Expected locale in Firefox: de_DE
Flags: needinfo?(david+bugzilla)

The severity field is not set for this bug.
:m_kato, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(m_kato)
Severity: -- → S3
Flags: needinfo?(m_kato)
Priority: -- → P3
See Also: → 1739712
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: