After landing bug bug 943283, no one uses nsIPlatformCharset::GetDefaultCharsetForLocale. Also, nsIPlatformCharset isn't scriptable interface, so it is unnecessary now.
MozReview-Commit-ID: Giy68AS9yK2
--HG--
extra : rebase_source : a0ae86c5472e1ed74b41c2f6af5cdace353b335d
This patch fixes a regression that we hit on Fennec when we handed over control
over language negotiation to LocaleService in bug 1347306.
The problem is that we currently do not have good Android bindings for
OSPreferences::GetSystemLocale and in result we could not negotiate
languages between user-selected OS locales and available locales.
The temporary solution implemented here binds android OS preferences to
`intl.locale.os` pref which is set on Locale:OS event in browser.js.
In LocaleService we add a listener on the pref to renegotiate languages
when OS locale changes.
MozReview-Commit-ID: KTqjYSzLNNO
--HG--
extra : rebase_source : 61b692e81ce67cdb15a7962e41ebe78164dbe1aa
Beta and release channel of Android still turn off ICU. So we should add UTF-8 version of nsICollation for fallback.
Some people want to keep --enale-intl-api=no for faster build on developer environment, so even if non-Android, it will be required.
MozReview-Commit-ID: 3RcjqoVip1W
--HG--
rename : intl/locale/unix/nsCollationUnix.cpp => intl/locale/nsCollationAndroid.cpp
extra : rebase_source : 6844f32efe8c37b020f30bc745d4d4d8e95c4158
nsICollation for macOS version uses ICU, so we should use it on all platform since nightly and aurora can use ICU on all platform.
MozReview-Commit-ID: 4nTzDCjOQXJ
--HG--
rename : intl/locale/tests/unit/test_collation_mac_icu.js => intl/locale/tests/unit/test_collation.js
extra : rebase_source : 3b47f9a521e79be929bb4c39d0c68b9438075e4c
nsCollation.cpp implements nsCollationFactory and nsCollation utils classes.
To remove nsIPlatfromCharset dependency, I would like to remove nsCollaction utils class. So at first, I would like to rename it to nsCollactionFactory.cpp. (then, nsICollation implementation will be nsCollation.cpp)
MozReview-Commit-ID: FaG3vfzi9cl
--HG--
rename : intl/locale/nsCollation.cpp => intl/locale/nsCollationFactory.cpp
rename : intl/locale/nsCollation.h => intl/locale/nsCollationFactory.h
extra : rebase_source : 25eebf52634310891d1bbcc974635b5cc4b1c402
After landing bug 1301640, 1st parameter of nsIScriptableDateFormat.FormatDateTime() is ignored now. So it is unnecessary to create nsILocaleService from locale parameter.
MozReview-Commit-ID: GlqC0D9shdy
In cases, where the caller is looking for the locale to be used for JS Intl API,
we can now replace it with `undefined` which causes JS Intl API to use the default
locale which since bug 1346674 is resolved to the app locale.
This allows us to remove a lot of calls for the app locale.
The remaining ones are split between `AsBCP47` and `AsLangTag`.
Here, the `AsLangTag` is used, as described in the API docs, for cases where
the language string is used for localization purposes, such as language negotaition
matching to our language resources etc.
`AsBCP47` is used when the returned value is handed over to ICU API.
MozReview-Commit-ID: DzmFEUvMq3N
--HG--
extra : rebase_source : 513ed31d995864939aa893e73c81ffdf591a6617
In cases, where the caller is looking for the locale to be used for JS Intl API,
we can now replace it with `undefined` which causes JS Intl API to use the default
locale which since bug 1346674 is resolved to the app locale.
This allows us to remove a lot of calls for the app locale.
The remaining ones are split between `AsBCP47` and `AsLangTag`.
Here, the `AsLangTag` is used, as described in the API docs, for cases where
the language string is used for localization purposes, such as language negotaition
matching to our language resources etc.
`AsBCP47` is used when the returned value is handed over to ICU API.
MozReview-Commit-ID: DzmFEUvMq3N
--HG--
extra : rebase_source : 13fa4c397ba4c79303a2cd76684b5b8c4bd17331
Sicne some tests doesn't work with --with-intl-api=no, we should skip it on Android
MozReview-Commit-ID: IjlH3aQdiqb
--HG--
extra : rebase_source : ac6d91bf291f6268ea29bcb29180b2f5197e012c
OSPreferences_unix.cpp is used on Android only. So we should rename it to OSPreferences_android.cpp
Also, we should create android directory into intl/locale, then move OSPreferences_android.cpp and nsAndroidCharset.cpp into it.
MozReview-Commit-ID: 2CUbV1Yc2fu
--HG--
rename : intl/locale/unix/OSPreferences_unix.cpp => intl/locale/android/OSPreferences_android.cpp
rename : intl/locale/unix/nsAndroidCharset.cpp => intl/locale/android/nsAndroidCharset.cpp
extra : rebase_source : f677428cc899c767e784b9f2c793b84e3fd95c11
Since we have to keep --with-intl-api=no setting, we allow OSPrefrences API wiout ENABLE_INTL_API.
MozReview-Commit-ID: 8sQHW6iq9Ss
--HG--
extra : rebase_source : 94e2efbeeb70f3edc519ffc9bfeaf7416ea1dc0e
I've moved the body of the APIs into the few remaining callers.
MozReview-Commit-ID: 9ALoSmQHkGM
--HG--
extra : rebase_source : e0e747dec23424446b18d53ab65e4fa262e16554