9

Link in add-on recommendation heading has incorrect text

 1 year ago
source link: https://bugzilla.mozilla.org/show_bug.cgi?id=1840953
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Details

(Keywords: regression, Whiteboard: [fidefe-reusable-components])

The moz-support-link in the add-on recommendations intro is having its text replaced with "Learn more" when it should be coming from its parents' fluent string. We'll likely need to teach moz-support-link to not localize itself even though it isn't given a fluent id

Whiteboard: [fidefe-reusable-components]

(In reply to Mark Striemer [:mstriemer] from comment #0)

Created attachment 9341627 [details]
image.png

The moz-support-link in the add-on recommendations intro is having its text replaced with "Learn more" when it should be coming from its parents' fluent string. We'll likely need to teach moz-support-link to not localize itself even though it isn't given a fluent id

Hey Mark,
based on a quick look I just gave to the moz-support-link custom element internals, it looks that if the is=moz-support-link element does have its own explicit data-l10n-id attribute then the custom element would not be overriding that localized string with its own "Learn more" default localized string: https://searchfox.org/mozilla-central/rev/ada05ac4faf1f79944a35a9eb79083a684a98975/toolkit/content/widgets/moz-support-link/moz-support-link.mjs#54-56

And so something like the following would also force the link to be localized as recommends (but to be considered as a valid fix only after we have also gathered L10n perspective about using this strategy):

diff --git a/toolkit/locales/en-US/toolkit/about/aboutAddons.ftl b/toolkit/locales/en-US/toolkit/about/aboutAddons.ftl
--- a/toolkit/locales/en-US/toolkit/about/aboutAddons.ftl
+++ b/toolkit/locales/en-US/toolkit/about/aboutAddons.ftl
@@ -313,6 +313,9 @@ discopane-intro =
     often developed by a third party. Here’s a selection { -brand-product-name }
     <a data-l10n-name="learn-more-trigger">recommends</a> for exceptional
     security, performance, and functionality.
+# This strings is going to be the one used for the data-l10n-name "learn-more-trigger"
+# link included in the discopane-intro string.
+discopane-intro-recommends-sumo-link = recommends
 
 # Notice to make user aware that the recommendations are personalized.
 discopane-notice-recommendations =
diff --git a/toolkit/mozapps/extensions/content/aboutaddons.html b/toolkit/mozapps/extensions/content/aboutaddons.html
--- a/toolkit/mozapps/extensions/content/aboutaddons.html
+++ b/toolkit/mozapps/extensions/content/aboutaddons.html
@@ -708,6 +708,7 @@
               is="moz-support-link"
               support-page="recommended-extensions-program"
               data-l10n-name="learn-more-trigger"
+              data-l10n-id="discopane-intro-recommends-sumo-link"
             >
             </a>
           </span>

This may also be a reasonable longer term fix (not just a shorter term one) if we would end up deciding to not add a new special case in the moz-support-link custom element (and instead prefer to leverage this existing special case based on having an explicit data-l10n-id attribute on the link element).

As an additional side note, should this bug block Bug 1801924?


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK