fix(imports): show a readable file format in the upload hint

The upload hint interpolated the raw `accept` string, so Trakt rendered
as "Upload a .json,.zip export…". Derive a label from `accept` with a new
locale-aware `formatList` helper ("JSON or ZIP"), and wrap the source
card descriptions in `msg` so they are translatable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jakeandClaude Opus 5.5 committed 2026-10-04 15:46:53 -04:00
1 parent 0c9ef44ea4
commit a2724abd89
15 files changed
+182 -7

No files matched your search

+15
View File
@@ -7,6 +7,7 @@ vi.mock("../src/index", () => ({
import {
formatBytes,
formatDate,
formatList,
formatNumber,
formatRelativeTime,
formatShortDate,
@@ -146,3 +147,17 @@ describe("formatBytes", () => {
expect(formatBytes(1536 * 1024)).toBe("1.5 MB");
});
});
describe("formatList", () => {
test("joins items as a conjunction by default", () => {
expect(formatList(["A", "B", "C"])).toBe("A, B, and C");
});
test("supports disjunctions", () => {
expect(formatList(["ZIP", "JSON"], { type: "disjunction" })).toBe("ZIP or JSON");
});
test("returns a single item unchanged", () => {
expect(formatList(["ZIP"], { type: "disjunction" })).toBe("ZIP");
});
});