mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 11:50:42 +00:00
Fix Control UI i18n tooltip placeholders
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.
This commit is contained in:
35
src/scripts/control-ui-i18n.test.ts
Normal file
35
src/scripts/control-ui-i18n.test.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
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"],
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user