Skip to content
Snippets Groups Projects
Commit 295b677d 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 3a806225
No related branches found
No related tags found
No related merge requests found
......@@ -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.
Finish editing this message first!
Please register or to comment