mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 20:50:44 +00:00
Summary:
- Render the Sessions active filter tooltip with the configured minute count instead of a literal N.
- Update all Control UI locale bundles and i18n translation memory rows to preserve the {count} placeholder.
- Add a placeholder parity guard to the Control UI i18n check with regression coverage.
Verification:
- pnpm ui:i18n:check
- pnpm test src/scripts/control-ui-i18n.test.ts ui/src/ui/views/sessions.test.ts
- git diff --check
- Testbox exact-head pnpm check:changed passed on prior rebased head 1333aac90b before latest main churn.
- GitHub CI on fd2068c378 only failed the pre-existing unrelated checks-node-core-fast timeout in src/auto-reply/reply/followup-delivery.test.ts:176, also present on recent main runs b31c001a2b and e5f5989aa9.
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { findPlaceholderMismatches } from "../../scripts/control-ui-i18n.ts";
|
|
|
|
describe("control-ui-i18n placeholder validation", () => {
|
|
it("reports missing and extra placeholders by key", () => {
|
|
const mismatches = findPlaceholderMismatches(
|
|
new Map([
|
|
["sessionsView.activeTooltip", "Updated in the last {count} minutes."],
|
|
["sessionsView.store", "Store: {path}"],
|
|
["sessionsView.limitTooltip", "Max sessions to load."],
|
|
]),
|
|
new Map([
|
|
["sessionsView.activeTooltip", "Actualizadas en los últimos N minutos."],
|
|
["sessionsView.store", "Almacén: {path}"],
|
|
["sessionsView.limitTooltip", "Máximo {extra} de sesiones."],
|
|
]),
|
|
"es",
|
|
);
|
|
|
|
expect(mismatches).toEqual([
|
|
{
|
|
key: "sessionsView.activeTooltip",
|
|
locale: "es",
|
|
sourcePlaceholders: ["count"],
|
|
translatedPlaceholders: [],
|
|
},
|
|
{
|
|
key: "sessionsView.limitTooltip",
|
|
locale: "es",
|
|
sourcePlaceholders: [],
|
|
translatedPlaceholders: ["extra"],
|
|
},
|
|
]);
|
|
});
|
|
});
|