Closed Bug 1898576 Opened 9 months ago Closed 8 months ago

amazon.fr/amazon.de aren't understood by analysis-explainer code; fills in "retailer" which isn't localized

Categories

(Firefox :: Shopping, defect, P2)

Desktop
All
defect

Tracking

()

RESOLVED FIXED
129 Branch
Tracking Status
firefox129 --- fixed

People

(Reporter: Gijs, Assigned: aarsenault)

References

Details

Attachments

(1 file, 1 obsolete file)

This code:

https://searchfox.org/mozilla-central/rev/a44891c52387ca4bd7c35b50f0d335f3980ef36a/browser/components/shopping/content/analysis-explainer.mjs#87-104

// It turns out we must always return a non-empty string: if not, the fluent
// resolver will complain that the variable value is missing. We use the
// placeholder "retailer", which should never be visible to users.
getRetailerDisplayName() {
  let defaultName = "retailer";
  if (!this.productUrl) {
    return defaultName;
  }
  let url = new URL(this.productUrl);
  let hostname = url.hostname;
  let displayNames = {
    "www.amazon.com": "Amazon",
    "www.bestbuy.com": "Best Buy",
    "www.walmart.com": "Walmart",
  };
  return displayNames[hostname] ?? defaultName;
}

inserts the retailer name in this string: https://searchfox.org/mozilla-central/rev/a44891c52387ca4bd7c35b50f0d335f3980ef36a/browser/locales/en-US/browser/shopping.ftl#154-158 .

At a minimum, this needs to add amazon.fr and de to the displayNames, though ideally we need to figure out a fallback solution that does use translation. That would need some templating changes to use a different string (without a substitute $retailer variable) if we cannot recognize the retailer name.

Severity: -- → S2
Priority: -- → P2
Assignee: nobody → aarsenault
Status: NEW → ASSIGNED
Attachment #9408162 - Attachment description: WIP: Bug 1898576 - adjust retailer name localization for .fr and .de → Bug 1898576 - adjust retailer name localization for .fr and .de
Attachment #9408248 - Attachment description: Bug 1898576 - adjust retailer name localization for .fr and .de; update variable name; fix lint r?#shopping-reviewers → Bug 1898576 - adjust retailer name localization for .fr and .de, r?#shopping-reviewers
Pushed by gijskruitbosch@gmail.com: https://hg.mozilla.org/integration/autoland/rev/371e9a516da2 adjust retailer name localization for .fr and .de, r=shopping-reviewers,fluent-reviewers,Gijs,bolsson
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
Attachment #9408162 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: