mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 22:55:24 +00:00
fix: file manager and sftp text showing raw i18n keys
This commit is contained in:
1 parent
9015d5dccb
commit
95a5e75495
38 files changed
+61
-45
No files matched your search
@@ -4,9 +4,9 @@ import "@testing-library/jest-dom/vitest";
|
||||
import { FileManagerGrid } from "../../src/frontend/FileManagerGrid";
|
||||
import type { FileItem } from "../../src/frontend/host-types";
|
||||
|
||||
vi.mock("react-i18next", () => ({
|
||||
vi.mock("@termix/plugin-sdk/frontend", async (importOriginal) => ({
|
||||
...(await importOriginal<typeof import("@termix/plugin-sdk/frontend")>()),
|
||||
useTranslation: () => ({ t: (key: string) => key }),
|
||||
initReactI18next: { type: "3rdParty", init: () => {} },
|
||||
}));
|
||||
|
||||
vi.mock("@tanstack/react-virtual", () => ({
|
||||
|
||||
@@ -35,12 +35,12 @@ const sonnerToast = vi.hoisted(() => {
|
||||
});
|
||||
vi.mock("sonner", () => ({ toast: sonnerToast }));
|
||||
|
||||
vi.mock("react-i18next", () => ({
|
||||
vi.mock("@termix/plugin-sdk/frontend", async (importOriginal) => ({
|
||||
...(await importOriginal<typeof import("@termix/plugin-sdk/frontend")>()),
|
||||
useTranslation: () => ({
|
||||
t: (key: string, opts?: Record<string, unknown>) =>
|
||||
opts?.count !== undefined ? `${key}:${opts.count}` : key,
|
||||
}),
|
||||
initReactI18next: { type: "3rdParty", init: () => {} },
|
||||
}));
|
||||
|
||||
const HOME = "/Users/max";
|
||||
|
||||
@@ -47,13 +47,9 @@ vi.mock("../../src/frontend/transferMetricsFormat", () => ({
|
||||
createFormatTransferMetrics: () => () => "",
|
||||
}));
|
||||
|
||||
vi.mock("react-i18next", () => ({
|
||||
useTranslation: () => ({ t: (key: string) => key }),
|
||||
initReactI18next: { type: "3rdParty", init: () => {} },
|
||||
}));
|
||||
|
||||
vi.mock("@termix/plugin-sdk/frontend", async (importOriginal) => ({
|
||||
...(await importOriginal<typeof import("@termix/plugin-sdk/frontend")>()),
|
||||
useTranslation: () => ({ t: (key: string) => key, language: "en" }),
|
||||
useSettings: () => ({
|
||||
values: { confirmBeforeTrash: api.confirmBeforeTrash },
|
||||
}),
|
||||
|
||||
@@ -26,12 +26,12 @@ vi.mock("../../../src/frontend/api/ssh-file-operations-api", () => api);
|
||||
vi.mock("sonner", () => ({
|
||||
toast: { loading: vi.fn(), success: vi.fn(), error: vi.fn() },
|
||||
}));
|
||||
vi.mock("react-i18next", () => ({
|
||||
vi.mock("@termix/plugin-sdk/frontend", async (importOriginal) => ({
|
||||
...(await importOriginal<typeof import("@termix/plugin-sdk/frontend")>()),
|
||||
useTranslation: () => ({
|
||||
t: (key: string, params?: { name?: string }) =>
|
||||
params?.name ? `${key}: ${params.name}` : key,
|
||||
}),
|
||||
initReactI18next: { type: "3rdParty", init: () => {} },
|
||||
}));
|
||||
vi.mock("../../../src/frontend/components/WindowManager", () => ({
|
||||
useWindowManager: () => ({
|
||||
|
||||
Reference in new issue
Block a user