From 46a52a0638ed07a99197ceaffdf462f87536b7a8 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Tue, 6 Oct 2026 20:39:45 +0200 Subject: [PATCH] test(app): reproduce relative times staying English in other languages Failing reproduction for #6238. Not a fix. --- .../app/src/i18n/relative-time.repro.test.ts | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 packages/app/src/i18n/relative-time.repro.test.ts diff --git a/packages/app/src/i18n/relative-time.repro.test.ts b/packages/app/src/i18n/relative-time.repro.test.ts new file mode 100644 index 0000000000..e6d35d417c --- /dev/null +++ b/packages/app/src/i18n/relative-time.repro.test.ts @@ -0,0 +1,32 @@ +import { afterEach, describe, expect, it } from "vitest"; +import { i18n } from "@/i18n/i18next"; +import { formatAge } from "@/git/pull-request-panel/data"; +import { formatCompactTimeAgo, formatTimeAgo } from "@/utils/time"; + +// Reproduction for https://github.com/getpaseo/paseo/issues/6238: relative times stay English +// when the app runs in another language. +describe("relative times in French", () => { + const now = Date.UTC(2026, 0, 1, 12, 0, 0); + const sixHoursAgo = now - 6 * 60 * 60_000; + + afterEach(async () => { + await i18n.changeLanguage("en"); + }); + + it("translates the PR panel's own just-now key", async () => { + await i18n.changeLanguage("fr"); + expect(i18n.t("workspace.git.pr.time.justNow")).not.toBe("just now"); + }); + + it("words the PR panel activity age in French", async () => { + await i18n.changeLanguage("fr"); + expect(formatAge(sixHoursAgo, now)).not.toBe("6h ago"); + expect(formatAge(now - 20_000, now)).not.toBe("just now"); + }); + + it("words the shared relative time in French", async () => { + await i18n.changeLanguage("fr"); + expect(formatTimeAgo(new Date(sixHoursAgo), new Date(now))).not.toBe("6h ago"); + expect(formatCompactTimeAgo(new Date(now - 20_000), new Date(now))).not.toBe("now"); + }); +});