Bug 1960383 - Remove vestigial logic related to browser.translations.panelShown r=nordzilla,translations-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D245636
This commit is contained in:
Jason Jones
2025-04-17 13:30:17 +00:00
parent 1b99e36416
commit 5cd2cad9d7
6 changed files with 15 additions and 17 deletions

View File

@@ -2641,9 +2641,22 @@ export var Policies = {
param.FeatureRecommendations,
param.Locked
);
// We use the mostRecentTargetLanguages pref to control the
// translations panel intro. Setting a language value simulates a
// first translation, which skips the intro panel for users with
// FeatureRecommendations disabled.
const topWebPreferredLanguage = Services.prefs
.getComplexValue("intl.accept_languages", Ci.nsIPrefLocalizedString)
.data.split(/\s*,\s*/g)[0];
const preferredLanguage = topWebPreferredLanguage.length
? topWebPreferredLanguage
: Services.locale.appLocaleAsBCP47;
PoliciesUtils.setDefaultPref(
"browser.translations.panelShown",
!param.FeatureRecommendations,
"browser.translations.mostRecentTargetLanguages",
param.FeatureRecommendations ? "" : preferredLanguage,
param.Locked
);
}