From 414d8b64c3158c61a1fbdda87aa194be3db26464 Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Thu, 6 Aug 2026 10:05:13 +0900 Subject: [PATCH] fix(app): localize provider usage time counts --- packages/app/src/usage/format.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/app/src/usage/format.test.ts b/packages/app/src/usage/format.test.ts index f4e1ac4f0c..939628e26d 100644 --- a/packages/app/src/usage/format.test.ts +++ b/packages/app/src/usage/format.test.ts @@ -40,4 +40,15 @@ describe("formatAmount", () => { it("formats percentages with locale-specific spacing", () => { expect(formatPct(42, "fr")).toBe("42\u00a0%"); }); + + it("formats relative-time counts with the active locale", async () => { + await i18n.changeLanguage("fr"); + const days = 1_234; + const daysFromNow = new Date(NOW + days * 24 * 60 * 60 * 1000).toISOString(); + const daysAgo = new Date(NOW - days * 24 * 60 * 60 * 1000).toISOString(); + + expect(formatResetLabel(daysFromNow, NOW)).toBe("se réinitialise dans 1\u202f234 j"); + expect(formatRunsOutLabel(daysFromNow, NOW)).toBe("s’épuise dans 1\u202f234 j"); + expect(formatAgo(daysAgo, NOW)).toBe("il y a 1\u202f234 j"); + }); });