Bug 1410733 - Add an en-US locale as a hard fallback for LocaleService::RequestedLocales. r=jfkthame

MozReview-Commit-ID: LPS3PaeykEh

--HG--
extra : rebase_source : fd2ef3aaa10c809e93d4fe1bf9f962689c1bb9aa
This commit is contained in:
Zibi Braniecki 2017-10-22 11:00:09 -07:00
Родитель d7d7a3bbb9
Коммит 63fc064db9
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -292,6 +292,16 @@ LocaleService::GetRequestedLocales(nsTArray<nsCString>& aRetVal)
{
if (mRequestedLocales.IsEmpty()) {
ReadRequestedLocales(mRequestedLocales);
// en-US is a LastResort locale. LastResort locale is a fallback locale
// for the requested locale chain. In the future we'll want to make the
// fallback chain differ per-locale. For now, it'll always fallback on en-US.
//
// Notice: This is not the same as DefaultLocale,
// which follows the default locale the build is in.
if (!mRequestedLocales.Contains("en-US")) {
mRequestedLocales.AppendElement("en-US");
}
}
aRetVal = mRequestedLocales;