Skip to content
Snippets Groups Projects
Commit 9cf53e50 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern:
Browse files

Bug 1875313 - Use en-US as a fallback when spoof English is enabled in ICUUtils. r=timhuang,tjr

parent 226f795b
1 merge request!980Bug 42512: Rebased alpha onto Firefox 115.10.0esr
......@@ -47,8 +47,13 @@ void ICUUtils::LanguageTagIterForContent::GetNext(nsACString& aBCP47LangTag) {
if (mCurrentFallbackIndex < 2) {
mCurrentFallbackIndex = 2;
// Else take the app's locale:
// Else take the app's locale (or en-US, if spoof English applies):
const bool spoofLocale = nsContentUtils::SpoofLocaleEnglish() &&
!mContent->OwnerDoc()->AllowsL10n();
if (spoofLocale) {
aBCP47LangTag.AssignLiteral("en-US");
return;
}
nsAutoCString appLocale;
LocaleService::GetInstance()->GetAppLocaleAsBCP47(aBCP47LangTag);
return;
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment