From d4f932ff178bed1fafae19e0bc76b406359bb4e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Z=C3=BCnd?= Date: Mon, 25 Oct 2021 12:21:57 +0200 Subject: [PATCH] [l10n] Remove the localized DevTools experiment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The localized DevTools experiment has been enabled by default since M94. With M97, we remove the experiment altogether. Users won't be affected as English is always the default locale for DevTools even with the experiment enabled. R=dsv@chromium.org Bug: None Change-Id: I88bedfbcc38b9ace58dfbf3bfa84b4e3214fdebe Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3240943 Reviewed-by: Danil Somsikov Commit-Queue: Simon Zünd --- front_end/core/host/UserMetrics.ts | 1 - front_end/core/root/Runtime.ts | 1 - front_end/entrypoints/main/MainImpl.ts | 12 +----------- front_end/entrypoints/main/main-meta.ts | 1 - .../panels/lighthouse/LighthouseProtocolService.ts | 6 +----- front_end/ui/legacy/InspectorView.ts | 4 ---- 6 files changed, 2 insertions(+), 23 deletions(-) diff --git a/front_end/core/host/UserMetrics.ts b/front_end/core/host/UserMetrics.ts index c23925b16c..f811bb8dac 100644 --- a/front_end/core/host/UserMetrics.ts +++ b/front_end/core/host/UserMetrics.ts @@ -569,7 +569,6 @@ export const DevtoolsExperiments: { 'ignoreListJSFramesOnTimeline': 43, 'contrastIssues': 44, 'experimentalCookieFeatures': 45, - 'localizedDevTools': 46, 'bfcacheDebugging': 47, 'hideIssuesFeature': 48, 'reportingApiDebugging': 49, diff --git a/front_end/core/root/Runtime.ts b/front_end/core/root/Runtime.ts index 98f40bacb6..c5ef8db03e 100644 --- a/front_end/core/root/Runtime.ts +++ b/front_end/core/root/Runtime.ts @@ -554,7 +554,6 @@ export enum ExperimentName { ALL = '*', PROTOCOL_MONITOR = 'protocolMonitor', WEBAUTHN_PANE = 'webauthnPane', - LOCALIZED_DEVTOOLS = 'localizedDevTools', SYNC_SETTINGS = 'syncSettings', } diff --git a/front_end/entrypoints/main/MainImpl.ts b/front_end/entrypoints/main/MainImpl.ts index b112a2842c..d41d29314a 100644 --- a/front_end/entrypoints/main/MainImpl.ts +++ b/front_end/entrypoints/main/MainImpl.ts @@ -151,13 +151,7 @@ export class MainImpl { } async requestAndRegisterLocaleData(): Promise { - // The language setting is only available when the experiment is enabled. - // TODO(crbug.com/1163928): Remove the check when the experiment is gone. - let settingLanguage = 'en-US'; - if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.LOCALIZED_DEVTOOLS)) { - settingLanguage = Common.Settings.Settings.instance().moduleSetting('language').get(); - } - + const settingLanguage = Common.Settings.Settings.instance().moduleSetting('language').get(); const devToolsLocale = i18n.DevToolsLocale.DevToolsLocale.instance({ create: true, data: { @@ -325,15 +319,11 @@ export class MainImpl { // Hide Issues Feature. Root.Runtime.experiments.register('groupAndHideIssuesByKind', 'Allow grouping and hiding of issues by IssueKind'); - // Localized DevTools, hide "locale selector" setting behind an experiment. - Root.Runtime.experiments.register(Root.Runtime.ExperimentName.LOCALIZED_DEVTOOLS, 'Enable localized DevTools'); - // Checkbox in the Settings UI to enable Chrome Sync is behind this experiment. Root.Runtime.experiments.register( Root.Runtime.ExperimentName.SYNC_SETTINGS, 'Sync DevTools settings with Chrome Sync'); Root.Runtime.experiments.enableExperimentsByDefault([ - Root.Runtime.ExperimentName.LOCALIZED_DEVTOOLS, 'sourceOrderViewer', 'hideIssuesFeature', 'bfcacheDebugging', diff --git a/front_end/entrypoints/main/main-meta.ts b/front_end/entrypoints/main/main-meta.ts index 1ed1b8aedf..003ef1cf0d 100644 --- a/front_end/entrypoints/main/main-meta.ts +++ b/front_end/entrypoints/main/main-meta.ts @@ -769,7 +769,6 @@ Common.Settings.registerSettingExtension({ ...filterLocalesForSettings().map(locale => createOptionForLocale(locale)), ], reloadRequired: true, - experiment: Root.Runtime.ExperimentName.LOCALIZED_DEVTOOLS, }); Common.Settings.registerSettingExtension({ diff --git a/front_end/panels/lighthouse/LighthouseProtocolService.ts b/front_end/panels/lighthouse/LighthouseProtocolService.ts index b2440a1f28..33df275118 100644 --- a/front_end/panels/lighthouse/LighthouseProtocolService.ts +++ b/front_end/panels/lighthouse/LighthouseProtocolService.ts @@ -5,7 +5,6 @@ import * as i18n from '../../core/i18n/i18n.js'; import type * as ProtocolClient from '../../core/protocol_client/protocol_client.js'; import * as SDK from '../../core/sdk/sdk.js'; -import * as Root from '../../core/root/root.js'; import type * as ReportRenderer from './LighthouseReporterTypes.js'; @@ -35,10 +34,7 @@ export class ProtocolService { } getLocales(): readonly string[] { - if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.LOCALIZED_DEVTOOLS)) { - return [i18n.DevToolsLocale.DevToolsLocale.instance().locale]; - } - return navigator.languages; + return [i18n.DevToolsLocale.DevToolsLocale.instance().locale]; } startLighthouse(auditURL: string, categoryIDs: string[], flags: Object): Promise { diff --git a/front_end/ui/legacy/InspectorView.ts b/front_end/ui/legacy/InspectorView.ts index bb88d3e403..cb0709774e 100644 --- a/front_end/ui/legacy/InspectorView.ts +++ b/front_end/ui/legacy/InspectorView.ts @@ -443,10 +443,6 @@ function getDisableLocaleInfoBarSetting(): Common.Settings.Setting { } function shouldShowLocaleInfobar(): boolean { - if (!Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.LOCALIZED_DEVTOOLS)) { - return false; - } - if (getDisableLocaleInfoBarSetting().get()) { return false; }