Skip to content
Snippets Groups Projects
Verified Commit f8413fef 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 f4e18ac3
Branches
Tags
1 merge request!1453TB 43587: Rebased legacy onto 115.22.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