fix(i18n): complete command center texts and merge client fallbacks
CI / check (push) Successful in 1m41s
CI / deploy (push) Successful in 1m37s
CI / e2e (push) Successful in 22s

This commit is contained in:
Simo committed 2026-09-05 20:24:41 +02:00
1 parent 8b59bd1d2d
commit b12e405b34
5 files changed
+272 -5

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
export type MessageTree = { [key: string]: string | MessageTree };
/** Fill missing translations before sending messages to server and client consumers. */
export function mergeMessages(
fallback: MessageTree,
localized: MessageTree,
): MessageTree {
const result: MessageTree = { ...fallback };
for (const [key, value] of Object.entries(localized)) {
const base = fallback[key];
result[key] =
typeof value === "object" && typeof base === "object"
? mergeMessages(base, value)
: value;
}
return result;
}