The accepted file types hint that s-drop-zone renders under its button is always in English, whatever the admin language is. The rest of the component is localized correctly. In the screenshot below (admin set to Arabic), the “Add files” button shows as “إضافة ملفات”, but the hint under it still reads “Accepts .jpg, .png, and .webp”.
Steps to reproduce
-
Switch the Shopify admin language to a language other than English (e.g. Arabic).
-
In an embedded app that loads
https://cdn.shopify.com/shopifycloud/polaris-2.js, render:<s-drop-zone label="Logo" accept="image/jpeg,image/png,image/webp"></s-drop-zone> -
Open the app page.
Expected: the accepted file types hint is translated, like the “Add files” button and the drag overlay text (“Drop files to upload”).
Actual: the hint is always English: “Accepts .jpg, .png, and .webp”.
Findings from the current polaris-2.js bundle
The hint is built from the accept value using string literals. It doesn’t go through the translator the rest of the component uses (translate("actions.addFiles"), translate("dropZone.dropFilesToUpload"), and so on). The hardcoded strings include:
"Accepts all file types""Accepts specified file types""Accepts " + type`Accepts ${a} and ${b}``Accepts ${list.join(", ")}, and ${last}`" files", used as a suffix for wildcard MIME types likeimage/*
The list joining (", ", ", and ") is English-only as well. Intl.ListFormat with the admin locale would handle it.
