refactor: consolidate English translations (#6640)

This commit is contained in:
Thomas authored and GitHub committed 2026-08-21 19:00:27 +02:00
1 parent 81aa704537
commit 9e14a07e64
449 files changed
+3515 -3922

No files matched your search

@@ -7,16 +7,18 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
vi.mock("@homarr/translation/client", () => {
const translations: Record<string, string> = {
"progress.title": "Restoring database...",
"progress.restarting": "Restarting server",
"timeout.title": "Server did not come back online",
"timeout.message": "Retry the connection check or refresh this page manually.",
tryAgain: "Try again",
"docker.action.refresh.label": "Refresh",
"management.page.tool.backup.restore.progress.title": "Restoring database...",
"management.page.tool.backup.restore.progress.restarting": "Restarting server",
"management.page.tool.backup.restore.timeout.title": "Server did not come back online",
"management.page.tool.backup.restore.timeout.message": "Retry the connection check or refresh this page manually.",
"common.action.tryAgain": "Try again",
"common.action.refresh": "Refresh",
};
return {
useScopedI18n: () => (key: string) => translations[key] ?? key,
useI18n: () => (key: string) => translations[key] ?? key,
useI18n: (namespace?: string) => (key: string) => {
const fullKey = namespace ? `${namespace}.${key}` : key;
return translations[fullKey] ?? key;
},
};
});