Closed Bug 1475876 Opened Last year Closed Last year

intl.locale.requested doesn't affect to JS locale unless Language Pack is installed


(Core :: JavaScript: Internationalization API, defect)

61 Branch
Not set





(Reporter: nobuoka, Unassigned)


User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0
Build ID: 20180704003137

Steps to reproduce:

1. Install Firefox for en-US (I tried on Windows 10 and Ubuntu 18.04 either)
2. Change value of pref `intl.locale.requested` to "ja"
3. Execute JS on web page or on console to check locale: `new Date().toLocaleString()`

Actual results:

The result string is not ja locale (such as "2018/7/16 4:08:05"), but en-US locale (such as "7/16/2018, 4:08:08 AM").

Expected results:

The result string should be ja locale (such as "2018/7/16 4:08:05").

I know that the result string will be ja locale if Japanese Language Pack is installed or Firefox for ja is used.
I want to know whether it is bug or not the result is not ja locale unless Japanese Language Pack is not installed.

I using Firefox with geckodriver as WebDriver remote end, it's very useful for me that `intl.locale.requested` pref will affect to JS locale unless Language Pack is installed.
Component: Untriaged → JavaScript: Internationalization API
Product: Firefox → Core
Thank you for reporting.

This is intentional, JS context locale is tied to Firefox locale, not requested locale.
Closed: Last year
Resolution: --- → WORKSFORME
(In reply to Zibi Braniecki [:gandalf][:zibi] from comment #1)
> This is intentional, JS context locale is tied to Firefox locale, not
> requested locale.

Thanks for your answer. But I'm wondering about locale more. Can I ask you more questions?

1. What is “Firefox locale”? 
In case that `ja` lacale is requested but Japanese Language Pack is not installed, then Firefox locale will be Firefox's default locale (I think that the locale of downloaded Firefox binary from is Firefox's default locale), isn't it?

2. Is `intl.locale.requested=en-US` special?
In case that Firefox binary for ja locale ( ) is installed and `intl.locale.requested=en-US` pref is set (English Language Pack is not installed, Firefox UI is ja locale), the result of `new Date().toLocaleString()` is en-US locale (such as "7/18/2018, 1:27:12 AM"). Is this intentional?
I think Firefox locale is ja in this case, so that the result should be ja locale, shouldn't it?

> 1. What is “Firefox locale”? 

Great question!

Please, read about it in our documentation:

> 2. Is `intl.locale.requested=en-US` special?

No, but `en-US` is special for us - it's what we call `last fallback locale` - read about it here:
I understood about locales.
Thanks so much!
You need to log in before you can comment on or make changes to this bug.