commit b34e9bccc3b72d649071bd59cedfc0554129f044 parent fb25e83f146bfdcf16170cdbba5773a87bd55f34 Author: Cosmin Sabou <csabou@mozilla.com> Date: Tue, 4 Nov 2025 17:49:36 +0200 Revert "Bug 1997594 - Update Firefox for Android localized strings related to soft-blocked add-ons. r=willdurand,android-l10n-reviewers,android-addons-reviewers,delphine" for failures on AddonsManagerAdapterTest This reverts commit e0141a55650326d71c0f52c8f10a077c73ed4f54. Revert "Bug 1997594 - Update Firefox Desktop localized strings related to soft-blocked add-ons. r=willdurand,fluent-reviewers,bolsson" This reverts commit 606c266edd1024500eeb7cc9b0f61e28ca58d7bd. Diffstat:
16 files changed, 49 insertions(+), 56 deletions(-)
diff --git a/browser/base/content/browser-addons.js b/browser/base/content/browser-addons.js @@ -97,7 +97,7 @@ const ERROR_L10N_IDS = new Map([ ], [ -14, - ["addon-install-error-soft-blocked2", "addon-install-error-soft-blocked2"], + ["addon-install-error-soft-blocked", "addon-install-error-soft-blocked"], ], ]); @@ -715,7 +715,7 @@ customElements.define( const { messagebar } = this; if (this.isSoftBlocked) { const SOFTBLOCK_FLUENTID = - "unified-extensions-item-messagebar-softblocked2"; + "unified-extensions-item-messagebar-softblocked"; if ( messagebar.messageL10nId === SOFTBLOCK_FLUENTID && messagebar.messageL10nArgs?.extensionName === this.extensionName @@ -3092,11 +3092,11 @@ var gUnifiedExtensions = { extensionName = addons[0].name; messageBarFluentId = hasHardBlocked ? "unified-extensions-mb-blocklist-error-single" - : "unified-extensions-mb-blocklist-warning-single2"; + : "unified-extensions-mb-blocklist-warning-single"; } else { messageBarFluentId = hasHardBlocked ? "unified-extensions-mb-blocklist-error-multiple" - : "unified-extensions-mb-blocklist-warning-multiple2"; + : "unified-extensions-mb-blocklist-warning-multiple"; } const messageBarBlocklist = this._makeMessageBar({ diff --git a/browser/components/extensions/test/browser/browser_unified_extensions_empty_panel.js b/browser/components/extensions/test/browser/browser_unified_extensions_empty_panel.js @@ -571,7 +571,7 @@ async function do_test_empty_state_with_blocklisted_addon(isSoftBlock) { window.document.l10n.getAttributes(messages[0]), { id: isSoftBlock - ? "unified-extensions-mb-blocklist-warning-single2" + ? "unified-extensions-mb-blocklist-warning-single" : "unified-extensions-mb-blocklist-error-single", args: { extensionName: "Name of the blocked ext", diff --git a/browser/components/extensions/test/browser/browser_unified_extensions_item_messagebar.js b/browser/components/extensions/test/browser/browser_unified_extensions_item_messagebar.js @@ -161,7 +161,7 @@ add_task(async function test_softblocked_item_messagebar() { addonId: addon.id, isCUIWidget: true, expectVisible: true, - expectFluentId: "unified-extensions-item-messagebar-softblocked2", + expectFluentId: "unified-extensions-item-messagebar-softblocked", expectFluentArgs: { extensionName: addon.name }, }); await closeExtensionsPanel(); @@ -192,7 +192,7 @@ add_task(async function test_softblocked_item_messagebar() { expectInArea: CustomizableUI.AREA_BOOKMARKS, expectOverflowedWidget: true, expectVisible: true, - expectFluentId: "unified-extensions-item-messagebar-softblocked2", + expectFluentId: "unified-extensions-item-messagebar-softblocked", expectFluentArgs: { extensionName: addon.name }, }); await closeExtensionsPanel(); @@ -224,7 +224,7 @@ add_task(async function test_softblocked_item_messagebar() { addonId: addon.id, isCUIWidget: false, expectVisible: true, - expectFluentId: "unified-extensions-item-messagebar-softblocked2", + expectFluentId: "unified-extensions-item-messagebar-softblocked", expectFluentArgs: { extensionName: addon.name }, }); await closeExtensionsPanel(); diff --git a/browser/components/extensions/test/browser/browser_unified_extensions_messages.js b/browser/components/extensions/test/browser/browser_unified_extensions_messages.js @@ -350,7 +350,7 @@ async function runBlockedExtensionsTestCase({ testSoftBlocks = false }) { type: testSoftBlocks ? "warning" : "error", fluentAttributes: { id: testSoftBlocks - ? "unified-extensions-mb-blocklist-warning-single2" + ? "unified-extensions-mb-blocklist-warning-single" : "unified-extensions-mb-blocklist-error-single", args: { extensionName: addon1.name, @@ -432,7 +432,7 @@ async function runBlockedExtensionsTestCase({ testSoftBlocks = false }) { type: testSoftBlocks ? "warning" : "error", fluentAttributes: { id: testSoftBlocks - ? "unified-extensions-mb-blocklist-warning-multiple2" + ? "unified-extensions-mb-blocklist-warning-multiple" : "unified-extensions-mb-blocklist-error-multiple", args: { extensionsCount: 2, diff --git a/browser/locales/en-US/browser/addonNotifications.ftl b/browser/locales/en-US/browser/addonNotifications.ftl @@ -134,6 +134,6 @@ addon-local-install-no-addon-name-error-file-access = The add-on could not be in # $appVersion (String): the application version. addon-install-error-incompatible = { $addonName } could not be installed because it is not compatible with { -brand-short-name } { $appVersion }. addon-install-error-hard-blocked = { $addonName } violates Mozilla’s policies and can’t be installed on { -brand-short-name }. -addon-install-error-soft-blocked2 = { $addonName } is restricted and can’t be installed on { -brand-short-name }. +addon-install-error-soft-blocked = { $addonName } violates Mozilla’s policies and can’t be installed on { -brand-short-name }. # Enterprise policies is a feature aimed at system administrators who want to deploy custom settings for Firefox. addon-install-error-admin-install-only = You cannot install { $addonName } as an end user, it can only be installed by an organization using enterprise policies. diff --git a/browser/locales/en-US/browser/unifiedExtensions.ftl b/browser/locales/en-US/browser/unifiedExtensions.ftl @@ -32,7 +32,7 @@ unified-extensions-item-message-manage = Manage extension # Variables: # $extensionName (String) - Name of the user-enabled soft-blocked extension. -unified-extensions-item-messagebar-softblocked2 = { $extensionName } is restricted. Using it may be risky. +unified-extensions-item-messagebar-softblocked = { $extensionName } violates Mozilla’s policies. Using it may be risky. ## Extension's context menu @@ -71,10 +71,10 @@ unified-extensions-mb-about-addons-link = Go to extension settings # Variables: # $extensionName (String) - Name of the extension disabled through a soft-block. -unified-extensions-mb-blocklist-warning-single2 = +unified-extensions-mb-blocklist-warning-single = .heading = { $extensionName } disabled .message = - This extension is restricted and has been disabled. + This extension violates Mozilla’s policies and has been disabled. You can enable it in settings, but this may be risky. # Variables: @@ -86,13 +86,13 @@ unified-extensions-mb-blocklist-error-single = # Variables: # $extensionsCount (Number) - Number of extensions disabled through both soft and hard-blocks (always going to be greater than 1) -unified-extensions-mb-blocklist-warning-multiple2 = +unified-extensions-mb-blocklist-warning-multiple = .heading = { $extensionsCount -> *[other] { $extensionsCount } extensions disabled } .message = - Some of your extensions are restricted and have been disabled. + Some of your extensions have been disabled for violating Mozilla’s policies. You can enable them in settings, but this may be risky. # Variables: diff --git a/mobile/android/android-components/components/feature/addons/src/main/java/mozilla/components/feature/addons/ui/AddonsManagerAdapter.kt b/mobile/android/android-components/components/feature/addons/src/main/java/mozilla/components/feature/addons/ui/AddonsManagerAdapter.kt @@ -571,9 +571,9 @@ class AddonsManagerAdapter( // Soft-blocked add-ons can be re-enabled. That's why we check whether the add-on is enabled // first. if (addon.isEnabled()) { - R.string.mozac_feature_addons_status_softblocked_re_enabled_2 + R.string.mozac_feature_addons_status_softblocked_re_enabled } else { - R.string.mozac_feature_addons_status_softblocked_2 + R.string.mozac_feature_addons_status_softblocked_1 }, ) // This learn more link should be underlined. diff --git a/mobile/android/android-components/components/feature/addons/src/main/res/layout/mozac_feature_addons_message_bars.xml b/mobile/android/android-components/components/feature/addons/src/main/res/layout/mozac_feature_addons_message_bars.xml @@ -55,7 +55,7 @@ android:layout_height="wrap_content" android:textColor="?attr/mozac_primary_text_color" android:textSize="14sp" - tools:text="@string/mozac_feature_addons_status_softblocked_2" + tools:text="@string/mozac_feature_addons_status_softblocked_1" tools:textColor="@color/photonDarkGrey90" /> <TextView diff --git a/mobile/android/android-components/components/feature/addons/src/main/res/values/strings.xml b/mobile/android/android-components/components/feature/addons/src/main/res/values/strings.xml @@ -361,9 +361,7 @@ <!-- Text shown when attempting to install an add-on that can only be install via Enterprise Policies, which is not supported on Android. %1$s is the add-on name. --> <string name="mozac_feature_addons_admin_install_only">%1$s could not be installed because it can only be installed by an organization using enterprise policies, which isn‘t supported on this platform.</string> <!-- Text shown when attempting to install an add-on that is soft-blocked. %1$s is the add-on name. %2$s is the app name. --> - <string name="mozac_feature_addons_soft_blocked_1" moz:removedIn="147" tools:ignore="UnusedResources">%1$s violates Mozilla’s policies and can’t be installed on %2$s.</string> - <!-- Text shown when attempting to install an add-on that is soft-blocked. %1$s is the add-on name. %2$s is the app name. --> - <string name="mozac_feature_addons_soft_blocked_2">%1$s is restricted and can’t be installed on %2$s.</string> + <string name="mozac_feature_addons_soft_blocked_1">%1$s violates Mozilla’s policies and can’t be installed on %2$s.</string> <!-- Text shown after failed to enable an add-on. %1$s is the add-on name. --> <string name="mozac_feature_addons_failed_to_enable">Failed to enable %1$s</string> <!-- Text shown after failed to disable an add-on. %1$s is the add-on name. --> @@ -409,13 +407,9 @@ <!-- Status message below an add-on in the add-ons manager when this add-on has been blocklisted. %1$s is the add-on name. --> <string name="mozac_feature_addons_status_blocklisted_1">This extension is blocked for violating Mozilla’s policies and has been disabled.</string> <!-- Status message below an add-on in the add-ons manager when this add-on has been soft-blocked. --> - <string name="mozac_feature_addons_status_softblocked_1" moz:removedIn="147" tools:ignore="UnusedResources">This extension is restricted for violating Mozilla’s policies and has been disabled. You can enable it, but this may be risky.</string> - <!-- Status message below an add-on in the add-ons manager when this add-on has been soft-blocked. --> - <string name="mozac_feature_addons_status_softblocked_2">This extension is restricted and has been disabled. You can enable it, but this may be risky.</string> - <!-- Status message below an add-on in the add-ons manager when this add-on has been soft-blocked but the user re-enabled it. --> - <string name="mozac_feature_addons_status_softblocked_re_enabled" moz:removedIn="147" tools:ignore="UnusedResources">This extension violates Mozilla’s policies. Using it may be risky.</string> + <string name="mozac_feature_addons_status_softblocked_1">This extension is restricted for violating Mozilla’s policies and has been disabled. You can enable it, but this may be risky.</string> <!-- Status message below an add-on in the add-ons manager when this add-on has been soft-blocked but the user re-enabled it. --> - <string name="mozac_feature_addons_status_softblocked_re_enabled_2">This extension is restricted. Using it may be risky.</string> + <string name="mozac_feature_addons_status_softblocked_re_enabled">This extension violates Mozilla’s policies. Using it may be risky.</string> <!-- Status message below an add-on in the add-ons manager when this add-on hasn't been signed correctly. %1$s is the add-on name. --> <string name="mozac_feature_addons_status_unsigned">%1$s could not be verified as secure and has been disabled.</string> <!-- Status message below an add-on in the add-ons manager when this add-on isn't compatible with the application version. %1$s is the add-on name, %2$s is the app name and %3$s is the app version. --> diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/extension/WebExtensionPromptFeature.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/extension/WebExtensionPromptFeature.kt @@ -184,7 +184,7 @@ class WebExtensionPromptFeature( is WebExtensionInstallException.SoftBlocked -> { url = formatBlocklistURL(exception) - context.getString(addonsR.string.mozac_feature_addons_soft_blocked_2, addonName, appName) + context.getString(addonsR.string.mozac_feature_addons_soft_blocked_1, addonName, appName) } is WebExtensionInstallException.UserCancelled -> { diff --git a/mobile/android/fenix/app/src/test/java/org/mozilla/fenix/extension/WebExtensionPromptFeatureTest.kt b/mobile/android/fenix/app/src/test/java/org/mozilla/fenix/extension/WebExtensionPromptFeatureTest.kt @@ -423,7 +423,7 @@ class WebExtensionPromptFeatureTest { ) val appName = testContext.getString(R.string.app_name) val expectedMessage = - testContext.getString(addonsR.string.mozac_feature_addons_soft_blocked_2, extensionName, appName) + testContext.getString(addonsR.string.mozac_feature_addons_soft_blocked_1, extensionName, appName) val expectedUrl = "${BuildConfig.AMO_BASE_URL}/android/blocked-addon/$extensionId/$extensionVersion/" val dialog = webExtensionPromptFeature.handleInstallationFailedRequest(exception = exception) diff --git a/toolkit/locales/en-US/toolkit/about/aboutAddons.ftl b/toolkit/locales/en-US/toolkit/about/aboutAddons.ftl @@ -574,14 +574,14 @@ details-notification-hard-blocked-other = .message = This add-on is blocked for violating Mozilla’s policies and has been disabled. details-notification-blocked-link2 = See Details -details-notification-soft-blocked-extension-disabled2 = - .message = This extension is restricted and has been disabled. You can enable it, but this may be risky. -details-notification-soft-blocked-extension-enabled2 = - .message = This extension is restricted. Using it may be risky. -details-notification-soft-blocked-other-disabled2 = - .message = This add-on is restricted and has been disabled. You can enable it, but this may be risky. -details-notification-soft-blocked-other-enabled2 = - .message = This add-on is restricted. Using it may be risky. +details-notification-soft-blocked-extension-disabled = + .message = This extension is restricted for violating Mozilla’s policies and has been disabled. You can enable it, but this may be risky. +details-notification-soft-blocked-extension-enabled = + .message = This extension violates Mozilla’s policies. Using it may be risky. +details-notification-soft-blocked-other-disabled = + .message = This add-on is restricted for violating Mozilla’s policies and has been disabled. You can enable it, but this may be risky. +details-notification-soft-blocked-other-enabled = + .message = This add-on violates Mozilla’s policies. Using it may be risky. details-notification-softblocked-link2 = See Details details-notification-gmp-pending2 = diff --git a/toolkit/mozapps/extensions/content/aboutaddons.js b/toolkit/mozapps/extensions/content/aboutaddons.js @@ -309,16 +309,7 @@ async function getAddonMessageInfo( type: "warning", }; } else if (addon.blocklistState === STATE_SOFTBLOCKED) { - const softBlockFluentIdsMap = { - extension: { - enabled: "details-notification-soft-blocked-extension-enabled2", - disabled: "details-notification-soft-blocked-extension-disabled2", - }, - other: { - enabled: "details-notification-soft-blocked-other-enabled2", - disabled: "details-notification-soft-blocked-other-disabled2", - }, - }; + const fluentBaseId = "details-notification-soft-blocked"; let typeSuffix = addon.type === "extension" ? "extension" : "other"; let stateSuffix; // If the Addon Card is not expanded, delay changing the messagebar @@ -329,7 +320,7 @@ async function getAddonMessageInfo( } else { stateSuffix = !isInDisabledSection ? "enabled" : "disabled"; } - let messageId = softBlockFluentIdsMap[typeSuffix][stateSuffix]; + let messageId = `${fluentBaseId}-${typeSuffix}-${stateSuffix}`; return { linkUrl: await addon.getBlocklistURL(), diff --git a/toolkit/mozapps/extensions/test/browser/browser_html_warning_messages.js b/toolkit/mozapps/extensions/test/browser/browser_html_warning_messages.js @@ -169,7 +169,7 @@ add_task(async function testSoftBlocked() { // Verify soft-block message on a softdisabled extension and theme. await testSoftBlockedAddon({ - expectedFluentId: "details-notification-soft-blocked-extension-disabled2", + expectedFluentId: "details-notification-soft-blocked-extension-disabled", mockAddon: { id: "softblocked-extension@mochi.test", name: "Soft-Blocked Extension", @@ -179,7 +179,7 @@ add_task(async function testSoftBlocked() { }, }); await testSoftBlockedAddon({ - expectedFluentId: "details-notification-soft-blocked-other-disabled2", + expectedFluentId: "details-notification-soft-blocked-other-disabled", mockAddon: { id: "softblocked-theme@mochi.test", name: "Soft-Blocked Theme", @@ -191,7 +191,7 @@ add_task(async function testSoftBlocked() { // Verify soft-block message on a re-enabled extension and theme. await testSoftBlockedAddon({ - expectedFluentId: "details-notification-soft-blocked-extension-enabled2", + expectedFluentId: "details-notification-soft-blocked-extension-enabled", mockAddon: { id: "softblocked-extension@mochi.test", name: "Soft-Blocked Extension", @@ -201,7 +201,7 @@ add_task(async function testSoftBlocked() { }, }); await testSoftBlockedAddon({ - expectedFluentId: "details-notification-soft-blocked-other-enabled2", + expectedFluentId: "details-notification-soft-blocked-other-enabled", mockAddon: { id: "softblocked-theme@mochi.test", name: "Soft-Blocked Theme", @@ -490,7 +490,7 @@ add_task(async function testCardRefreshedOnBlocklistStateChanges() { await checkAddonCard(doc, id, { linkUrl, text: { - id: `details-notification-soft-blocked-extension-disabled2`, + id: `details-notification-soft-blocked-extension-disabled`, linkId: "details-notification-softblocked-link2", }, type: "warning", @@ -507,7 +507,7 @@ add_task(async function testCardRefreshedOnBlocklistStateChanges() { await checkAddonCard(doc, id, { linkUrl, text: { - id: `details-notification-soft-blocked-extension-enabled2`, + id: `details-notification-soft-blocked-extension-enabled`, linkId: "details-notification-softblocked-link2", }, type: "warning", diff --git a/toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js b/toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js @@ -1071,7 +1071,7 @@ describe("Add-on installation doorhangers", function () { await testBlocklistedAddon({ stash: { softblocked: [`${id}:${version}`], blocked: [], unblocked: [] }, expected: { - fluentId: "addon-install-error-soft-blocked2", + fluentId: "addon-install-error-soft-blocked", blocklistURL, }, }); diff --git a/tools/lint/fluent-lint/exclusions.yml b/tools/lint/fluent-lint/exclusions.yml @@ -137,6 +137,7 @@ CO01: - trademarkInfo # browser/addonNotifications.ftl - addon-install-error-hard-blocked + - addon-install-error-soft-blocked # browser/appExtensionFields.ftl - extension-firefox-alpenglow-name # browser/browser.ftl @@ -156,8 +157,11 @@ CO01: - sync-engine-addons - sync-mobile-promo # browser/unifiedExtensions.ftl + - unified-extensions-item-messagebar-softblocked - unified-extensions-mb-blocklist-error-multiple - unified-extensions-mb-blocklist-error-single + - unified-extensions-mb-blocklist-warning-multiple + - unified-extensions-mb-blocklist-warning-single # devtools/client/locales/en-US/aboutdebugging.ftl - about-debugging-setup-usb-step-enable-debug-firefox2 - about-debugging-browser-version-too-old-fennec @@ -173,6 +177,10 @@ CO01: - addon-badge-verified4 - details-notification-hard-blocked-extension - details-notification-hard-blocked-other + - details-notification-soft-blocked-extension-disabled + - details-notification-soft-blocked-extension-enabled + - details-notification-soft-blocked-other-disabled + - details-notification-soft-blocked-other-enabled - plugins-openh264-description - recommended-theme-1 # toolkit/about/aboutSupport.ftl