Skip to content
Snippets Groups Projects
Verified Commit f4adbce0 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern:
Browse files

Bug 41698: Reword the recommendation badges in about:addons

Firefox strings use { -brand-product-name }.
As a result, it seems that the fork is recommending extensions, whereas
AMO curators are doing that.
So, we replace the strings with custom ones that clarify that Mozilla is
recommending them.

We assign the strings with JS because our translation backend does not
support Fluent attributes, yet, but once it does, we should switch to
them, instead.

Upstream bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1825033
parent 59f53216
Branches
Tags
1 merge request!653Bug 41795: Rebased alpha to 102.12
......@@ -24,6 +24,8 @@
<link rel="localization" href="toolkit/about/aboutAddons.ftl">
<link rel="localization" href="toolkit/about/abuseReports.ftl">
<link rel="localization" href="browser/languageNotification.ftl"/>
<!-- Defer scripts so all the templates are loaded by the time they run. -->
<script defer src="chrome://mozapps/content/extensions/aboutaddonsCommon.js"></script>
<script defer src="chrome://mozapps/content/extensions/abuse-reports.js"></script>
......@@ -153,7 +155,6 @@
is="support-link"
support-page="add-on-badges"
utmcontent="promoted-addon-badge"
data-l10n-id="addon-badge-recommended2"
hidden>
</a>
<a class="addon-badge addon-badge-line"
......@@ -167,7 +168,6 @@
is="support-link"
support-page="add-on-badges"
utmcontent="promoted-addon-badge"
data-l10n-id="addon-badge-verified2"
hidden>
</a>
<a class="addon-badge addon-badge-private-browsing-allowed"
......
......@@ -4885,6 +4885,29 @@ async function initialize() {
);
}
}
// At the moment we need to do this, because Weblate still does not support
// attributes in Fluent.
const [recommended, verified] = await document.l10n.formatValues([
{ id: "basebrowser-addon-badge-recommended" },
{ id: "basebrowser-addon-badge-verified" },
]);
importTemplate("card");
_templates.card.content
.querySelector(".addon-badge-recommended")
.setAttribute("title", recommended);
_templates.card.content
.querySelector(".addon-badge-verified")
.setAttribute("title", verified);
// We also update any template copy that has already been created.
for (const badge of document.querySelectorAll(".addon-badge-recommended")) {
badge.setAttribute("title", recommended);
}
for (const badge of document.querySelectorAll(".addon-badge-verified")) {
badge.setAttribute("title", verified);
}
}
window.promiseInitialized = new Promise(resolve => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment