diff --git a/eslint.config.mjs b/eslint.config.mjs index f404fee54..a8717f6d3 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -214,4 +214,23 @@ export default tseslint.config([ "termix-plugins/stay-inside": "error", }, }, + { + // react-i18next's hook reads core's namespace, so plugin strings show as raw keys. + files: ["plugins/*/src/**/*.{ts,tsx}"], + rules: { + "no-restricted-imports": [ + "error", + { + paths: [ + { + name: "react-i18next", + importNames: ["useTranslation", "Trans", "withTranslation"], + message: + "Use useTranslation from @termix/plugin-sdk/frontend so keys resolve in this plugin's namespace.", + }, + ], + }, + ], + }, + }, ]); diff --git a/plugins/file-manager/src/frontend/FileManager.tsx b/plugins/file-manager/src/frontend/FileManager.tsx index 353afe854..c234717ac 100644 --- a/plugins/file-manager/src/frontend/FileManager.tsx +++ b/plugins/file-manager/src/frontend/FileManager.tsx @@ -26,7 +26,7 @@ import { useDragToDesktop } from "./hooks/useDragToDesktop"; import { useDragToSystemDesktop } from "./hooks/useDragToSystemDesktop"; import { useConfirmation } from "@termix/plugin-sdk/ui"; import { toast } from "sonner"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import { FileManagerDialogs } from "./FileManagerDialogs.tsx"; import { PassphraseDialog } from "@termix/plugin-sdk/ui"; import { FileManagerToolbar } from "./FileManagerToolbar.tsx"; diff --git a/plugins/file-manager/src/frontend/FileManagerApp.tsx b/plugins/file-manager/src/frontend/FileManagerApp.tsx index da05ecd46..18f57ec7d 100644 --- a/plugins/file-manager/src/frontend/FileManagerApp.tsx +++ b/plugins/file-manager/src/frontend/FileManagerApp.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import { FileManager } from "./FileManager.tsx"; import { FullScreenAppWrapper, ConnectionScreen } from "@termix/plugin-sdk/ui"; diff --git a/plugins/file-manager/src/frontend/FileManagerContextMenu.tsx b/plugins/file-manager/src/frontend/FileManagerContextMenu.tsx index e58f52dc3..fbf33da55 100644 --- a/plugins/file-manager/src/frontend/FileManagerContextMenu.tsx +++ b/plugins/file-manager/src/frontend/FileManagerContextMenu.tsx @@ -21,7 +21,7 @@ import { ArrowRightLeft, Link, } from "lucide-react"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import { Kbd, KbdKey, KbdSeparator } from "@termix/plugin-sdk/ui"; const VIEWPORT_PADDING = 16; diff --git a/plugins/file-manager/src/frontend/FileManagerGrid.tsx b/plugins/file-manager/src/frontend/FileManagerGrid.tsx index c1f67bb61..b5c22d319 100644 --- a/plugins/file-manager/src/frontend/FileManagerGrid.tsx +++ b/plugins/file-manager/src/frontend/FileManagerGrid.tsx @@ -29,7 +29,7 @@ import { Move, GitCompare, } from "lucide-react"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import type { FileItem } from "./host-types"; import type { CreateIntent } from "./file-manager-types.ts"; import { formatFileSize } from "./file-manager-utils.ts"; diff --git a/plugins/file-manager/src/frontend/FileManagerSidebar.tsx b/plugins/file-manager/src/frontend/FileManagerSidebar.tsx index 175486796..af24f3f4b 100644 --- a/plugins/file-manager/src/frontend/FileManagerSidebar.tsx +++ b/plugins/file-manager/src/frontend/FileManagerSidebar.tsx @@ -16,7 +16,7 @@ import { ChevronDown, Check, } from "lucide-react"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import type { SSHHost } from "./host-types"; import { getRecentFiles, diff --git a/plugins/file-manager/src/frontend/FileManagerTrashDialog.tsx b/plugins/file-manager/src/frontend/FileManagerTrashDialog.tsx index d613e27c1..fef1264be 100644 --- a/plugins/file-manager/src/frontend/FileManagerTrashDialog.tsx +++ b/plugins/file-manager/src/frontend/FileManagerTrashDialog.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useState } from "react"; import { RotateCcw, Trash2 } from "lucide-react"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import { toast } from "sonner"; import { Button, diff --git a/plugins/file-manager/src/frontend/LocalFileContextMenu.tsx b/plugins/file-manager/src/frontend/LocalFileContextMenu.tsx index 2cd8b7288..4b2e0afcc 100644 --- a/plugins/file-manager/src/frontend/LocalFileContextMenu.tsx +++ b/plugins/file-manager/src/frontend/LocalFileContextMenu.tsx @@ -13,7 +13,7 @@ import { Trash2, Upload, } from "lucide-react"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import { Kbd, KbdKey, KbdSeparator } from "@termix/plugin-sdk/ui"; import type { LocalFileEntry } from "@termix/plugin-sdk/frontend"; diff --git a/plugins/file-manager/src/frontend/LocalFilePane.tsx b/plugins/file-manager/src/frontend/LocalFilePane.tsx index a0fbee422..ff78c9299 100644 --- a/plugins/file-manager/src/frontend/LocalFilePane.tsx +++ b/plugins/file-manager/src/frontend/LocalFilePane.tsx @@ -6,7 +6,7 @@ import React, { useState, } from "react"; import { useVirtualizer } from "@tanstack/react-virtual"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import { toast } from "sonner"; import { ArrowDown, diff --git a/plugins/file-manager/src/frontend/SftpTransferTab.tsx b/plugins/file-manager/src/frontend/SftpTransferTab.tsx index 5b41698b9..55c079495 100644 --- a/plugins/file-manager/src/frontend/SftpTransferTab.tsx +++ b/plugins/file-manager/src/frontend/SftpTransferTab.tsx @@ -9,8 +9,8 @@ import { type MouseEvent, } from "react"; import { toast } from "sonner"; -import { useTranslation } from "react-i18next"; -import type { TFunction } from "i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; +import type { TranslateFn as TFunction } from "@termix/plugin-sdk/frontend"; import { ArrowLeftRight, File as FileIcon, diff --git a/plugins/file-manager/src/frontend/SudoPasswordDialog.tsx b/plugins/file-manager/src/frontend/SudoPasswordDialog.tsx index 27fc83539..9ade2eea9 100644 --- a/plugins/file-manager/src/frontend/SudoPasswordDialog.tsx +++ b/plugins/file-manager/src/frontend/SudoPasswordDialog.tsx @@ -10,7 +10,7 @@ import { PasswordInput, } from "@termix/plugin-sdk/ui"; import { Shield } from "lucide-react"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; interface SudoPasswordDialogProps { open: boolean; diff --git a/plugins/file-manager/src/frontend/TransferMonitor.tsx b/plugins/file-manager/src/frontend/TransferMonitor.tsx index 38fd15b69..819bfa40c 100644 --- a/plugins/file-manager/src/frontend/TransferMonitor.tsx +++ b/plugins/file-manager/src/frontend/TransferMonitor.tsx @@ -1,5 +1,5 @@ import type { TranslateFn } from "@termix/plugin-sdk/frontend"; -import type { TFunction } from "i18next"; +import type { TranslateFn as TFunction } from "@termix/plugin-sdk/frontend"; import { getTransferStatus, listActiveTransfers } from "./api/transfer-api"; import { createFormatTransferMetrics } from "./transferMetricsFormat.ts"; import { diff --git a/plugins/file-manager/src/frontend/components/AudioPreview.tsx b/plugins/file-manager/src/frontend/components/AudioPreview.tsx index ac48503ec..f05ab1f81 100644 --- a/plugins/file-manager/src/frontend/components/AudioPreview.tsx +++ b/plugins/file-manager/src/frontend/components/AudioPreview.tsx @@ -3,7 +3,7 @@ import AudioPlayer from "react-h5-audio-player"; import "react-h5-audio-player/lib/styles.css"; import { Music } from "lucide-react"; import { cn } from "@termix/plugin-sdk/ui"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; interface FileItem { name: string; diff --git a/plugins/file-manager/src/frontend/components/ColumnVisibilityMenu.tsx b/plugins/file-manager/src/frontend/components/ColumnVisibilityMenu.tsx index bbe006bbe..81e513947 100644 --- a/plugins/file-manager/src/frontend/components/ColumnVisibilityMenu.tsx +++ b/plugins/file-manager/src/frontend/components/ColumnVisibilityMenu.tsx @@ -1,6 +1,6 @@ import { useEffect, useLayoutEffect, useRef, useState } from "react"; import { Check } from "lucide-react"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import { cn } from "@termix/plugin-sdk/ui"; import type { ResizableColumns } from "../hooks/useResizableColumns.ts"; diff --git a/plugins/file-manager/src/frontend/components/CompressDialog.tsx b/plugins/file-manager/src/frontend/components/CompressDialog.tsx index 5177e814f..092ffebcd 100644 --- a/plugins/file-manager/src/frontend/components/CompressDialog.tsx +++ b/plugins/file-manager/src/frontend/components/CompressDialog.tsx @@ -11,7 +11,7 @@ import { Label, } from "@termix/plugin-sdk/ui"; import { Package } from "lucide-react"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; interface CompressDialogProps { open: boolean; diff --git a/plugins/file-manager/src/frontend/components/DiffViewer.tsx b/plugins/file-manager/src/frontend/components/DiffViewer.tsx index 1a05a462b..c27dc3b96 100644 --- a/plugins/file-manager/src/frontend/components/DiffViewer.tsx +++ b/plugins/file-manager/src/frontend/components/DiffViewer.tsx @@ -4,7 +4,7 @@ import { DiffEditor } from "@monaco-editor/react"; import { Button } from "@termix/plugin-sdk/ui"; import { toast } from "sonner"; import { DownloadProgressToast } from "./DownloadProgressToast"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import { Download, RefreshCw, diff --git a/plugins/file-manager/src/frontend/components/DiffWindow.tsx b/plugins/file-manager/src/frontend/components/DiffWindow.tsx index a91756d52..01eddeff9 100644 --- a/plugins/file-manager/src/frontend/components/DiffWindow.tsx +++ b/plugins/file-manager/src/frontend/components/DiffWindow.tsx @@ -2,7 +2,7 @@ import React from "react"; import { DraggableWindow } from "./DraggableWindow.tsx"; import { DiffViewer } from "./DiffViewer.tsx"; import { useWindowManager } from "./WindowManager.tsx"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import type { FileItem, SSHHost } from "../host-types"; interface DiffWindowProps { diff --git a/plugins/file-manager/src/frontend/components/DownloadProgressToast.tsx b/plugins/file-manager/src/frontend/components/DownloadProgressToast.tsx index 747f951d0..dbbbe8ccf 100644 --- a/plugins/file-manager/src/frontend/components/DownloadProgressToast.tsx +++ b/plugins/file-manager/src/frontend/components/DownloadProgressToast.tsx @@ -1,5 +1,5 @@ import { formatTransferMbPerSec } from "../api/transfer-api"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import { ArrowDownToLine } from "lucide-react"; import { TransferProgressBar } from "./TransferProgressBar"; diff --git a/plugins/file-manager/src/frontend/components/DraggableWindow.tsx b/plugins/file-manager/src/frontend/components/DraggableWindow.tsx index 96824fb90..ea40f7217 100644 --- a/plugins/file-manager/src/frontend/components/DraggableWindow.tsx +++ b/plugins/file-manager/src/frontend/components/DraggableWindow.tsx @@ -1,7 +1,7 @@ import React, { useState, useRef, useCallback, useEffect } from "react"; import { cn } from "@termix/plugin-sdk/ui"; import { Minus, X, Maximize2, Minimize2 } from "lucide-react"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; interface DraggableWindowProps { title: string; diff --git a/plugins/file-manager/src/frontend/components/FileViewer.tsx b/plugins/file-manager/src/frontend/components/FileViewer.tsx index 741a3f68e..edca6e27f 100644 --- a/plugins/file-manager/src/frontend/components/FileViewer.tsx +++ b/plugins/file-manager/src/frontend/components/FileViewer.tsx @@ -1,7 +1,7 @@ /* eslint-disable react-hooks/exhaustive-deps */ import React, { Suspense, lazy, useState, useEffect, useRef } from "react"; import { cn } from "@termix/plugin-sdk/ui"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import { FileText, Image as ImageIcon, diff --git a/plugins/file-manager/src/frontend/components/FileWindow.tsx b/plugins/file-manager/src/frontend/components/FileWindow.tsx index 0c3ff5bd5..2db6bad3e 100644 --- a/plugins/file-manager/src/frontend/components/FileWindow.tsx +++ b/plugins/file-manager/src/frontend/components/FileWindow.tsx @@ -15,7 +15,7 @@ import { SudoPasswordDialog } from "../SudoPasswordDialog.tsx"; import { toast } from "sonner"; import { DownloadProgressToast } from "./DownloadProgressToast"; import type { SSHHost } from "../host-types"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; interface FileItem { name: string; diff --git a/plugins/file-manager/src/frontend/components/ImagePreview.tsx b/plugins/file-manager/src/frontend/components/ImagePreview.tsx index d8cb1bcf5..9ce597953 100644 --- a/plugins/file-manager/src/frontend/components/ImagePreview.tsx +++ b/plugins/file-manager/src/frontend/components/ImagePreview.tsx @@ -3,7 +3,7 @@ import { PhotoProvider, PhotoView } from "react-photo-view"; import "react-photo-view/dist/react-photo-view.css"; import { AlertCircle, Download } from "lucide-react"; import { Button } from "@termix/plugin-sdk/ui"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; interface ImagePreviewProps { content: string; diff --git a/plugins/file-manager/src/frontend/components/LocalTransferProgressToast.tsx b/plugins/file-manager/src/frontend/components/LocalTransferProgressToast.tsx index 9f5284859..8151a91fe 100644 --- a/plugins/file-manager/src/frontend/components/LocalTransferProgressToast.tsx +++ b/plugins/file-manager/src/frontend/components/LocalTransferProgressToast.tsx @@ -1,5 +1,5 @@ import { Button } from "@termix/plugin-sdk/ui"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import { formatFileSize } from "../file-manager-utils.ts"; export interface LocalTransferBatchStatus { diff --git a/plugins/file-manager/src/frontend/components/PdfPreview.tsx b/plugins/file-manager/src/frontend/components/PdfPreview.tsx index 0a0f56598..9d0c270cf 100644 --- a/plugins/file-manager/src/frontend/components/PdfPreview.tsx +++ b/plugins/file-manager/src/frontend/components/PdfPreview.tsx @@ -2,7 +2,7 @@ import React, { useState } from "react"; import { Document, Page, pdfjs } from "react-pdf"; import { AlertCircle, Download } from "lucide-react"; import { Button } from "@termix/plugin-sdk/ui"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import pdfjsWorkerUrl from "pdfjs-dist/build/pdf.worker.min.mjs?url"; pdfjs.GlobalWorkerOptions.workerSrc = pdfjsWorkerUrl; diff --git a/plugins/file-manager/src/frontend/components/PermissionsDialog.tsx b/plugins/file-manager/src/frontend/components/PermissionsDialog.tsx index 5eb7b858c..43ebc0964 100644 --- a/plugins/file-manager/src/frontend/components/PermissionsDialog.tsx +++ b/plugins/file-manager/src/frontend/components/PermissionsDialog.tsx @@ -9,7 +9,7 @@ import { Button, Input, } from "@termix/plugin-sdk/ui"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import { Lock } from "lucide-react"; interface FileItem { diff --git a/plugins/file-manager/src/frontend/components/TerminalWindow.tsx b/plugins/file-manager/src/frontend/components/TerminalWindow.tsx index e748ff5a2..7abcb364d 100644 --- a/plugins/file-manager/src/frontend/components/TerminalWindow.tsx +++ b/plugins/file-manager/src/frontend/components/TerminalWindow.tsx @@ -3,7 +3,7 @@ import { DraggableWindow } from "./DraggableWindow.tsx"; import type { TabHandle as TerminalHandle } from "@termix/plugin-sdk/frontend"; import { PluginComponent } from "@termix/plugin-sdk/ui"; import { useWindowManager } from "./WindowManager.tsx"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import type { SSHHost } from "../host-types"; import { ExternalLink } from "lucide-react"; diff --git a/plugins/file-manager/src/frontend/components/TransferProgressToast.tsx b/plugins/file-manager/src/frontend/components/TransferProgressToast.tsx index 9b6746bde..830b143f8 100644 --- a/plugins/file-manager/src/frontend/components/TransferProgressToast.tsx +++ b/plugins/file-manager/src/frontend/components/TransferProgressToast.tsx @@ -4,7 +4,7 @@ import { getTransferProgressPercent, type TransferProgressResponse, } from "../api/transfer-api"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import { Archive, ArchiveRestore, diff --git a/plugins/file-manager/src/frontend/components/TransferToHostDialog.tsx b/plugins/file-manager/src/frontend/components/TransferToHostDialog.tsx index f810391da..23fd915b8 100644 --- a/plugins/file-manager/src/frontend/components/TransferToHostDialog.tsx +++ b/plugins/file-manager/src/frontend/components/TransferToHostDialog.tsx @@ -18,7 +18,7 @@ import { Label, Select2, } from "@termix/plugin-sdk/ui"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import { toast } from "sonner"; import { ArrowRightLeft, diff --git a/plugins/file-manager/src/frontend/homepage/FileManagerWidget.tsx b/plugins/file-manager/src/frontend/homepage/FileManagerWidget.tsx index 579985f48..b7aa8742b 100644 --- a/plugins/file-manager/src/frontend/homepage/FileManagerWidget.tsx +++ b/plugins/file-manager/src/frontend/homepage/FileManagerWidget.tsx @@ -1,5 +1,5 @@ import { FolderSearch } from "lucide-react"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import { useHost } from "@termix/plugin-sdk/frontend"; import { WidgetTitle } from "@termix/plugin-sdk/ui"; import type { diff --git a/plugins/file-manager/src/frontend/hooks/useLocalTransfers.ts b/plugins/file-manager/src/frontend/hooks/useLocalTransfers.ts index 942c4fa1d..3ea737781 100644 --- a/plugins/file-manager/src/frontend/hooks/useLocalTransfers.ts +++ b/plugins/file-manager/src/frontend/hooks/useLocalTransfers.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect, useRef } from "react"; import { createElement } from "react"; import { toast } from "sonner"; -import { useTranslation } from "react-i18next"; +import { useTranslation } from "@termix/plugin-sdk/frontend"; import type { FileItem } from "../host-types"; import type { LocalWalkResult } from "@termix/plugin-sdk/frontend"; import { useSettings } from "@termix/plugin-sdk/frontend"; diff --git a/plugins/file-manager/src/frontend/transferMetricsFormat.ts b/plugins/file-manager/src/frontend/transferMetricsFormat.ts index 047da8d08..f7e054e70 100644 --- a/plugins/file-manager/src/frontend/transferMetricsFormat.ts +++ b/plugins/file-manager/src/frontend/transferMetricsFormat.ts @@ -1,4 +1,4 @@ -import type { TFunction } from "i18next"; +import type { TranslateFn as TFunction } from "@termix/plugin-sdk/frontend"; import { formatDurationMs, formatTransferMbPerSec, diff --git a/plugins/file-manager/src/frontend/transferProgressMonitor.tsx b/plugins/file-manager/src/frontend/transferProgressMonitor.tsx index 036deea06..ae1b742bf 100644 --- a/plugins/file-manager/src/frontend/transferProgressMonitor.tsx +++ b/plugins/file-manager/src/frontend/transferProgressMonitor.tsx @@ -1,6 +1,6 @@ import { getErrorMessage } from "./lib/error-message"; import { toast } from "sonner"; -import type { TFunction } from "i18next"; +import type { TranslateFn as TFunction } from "@termix/plugin-sdk/frontend"; import { pollTransferUntilComplete, cancelTransferToHost, diff --git a/plugins/file-manager/tests/frontend/FileManagerGrid.test.tsx b/plugins/file-manager/tests/frontend/FileManagerGrid.test.tsx index 198a04da8..3693b40d6 100644 --- a/plugins/file-manager/tests/frontend/FileManagerGrid.test.tsx +++ b/plugins/file-manager/tests/frontend/FileManagerGrid.test.tsx @@ -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()), useTranslation: () => ({ t: (key: string) => key }), - initReactI18next: { type: "3rdParty", init: () => {} }, })); vi.mock("@tanstack/react-virtual", () => ({ diff --git a/plugins/file-manager/tests/frontend/LocalFilePane.test.tsx b/plugins/file-manager/tests/frontend/LocalFilePane.test.tsx index c15419888..971016b62 100644 --- a/plugins/file-manager/tests/frontend/LocalFilePane.test.tsx +++ b/plugins/file-manager/tests/frontend/LocalFilePane.test.tsx @@ -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()), useTranslation: () => ({ t: (key: string, opts?: Record) => opts?.count !== undefined ? `${key}:${opts.count}` : key, }), - initReactI18next: { type: "3rdParty", init: () => {} }, })); const HOME = "/Users/max"; diff --git a/plugins/file-manager/tests/frontend/SftpTransferTab.test.tsx b/plugins/file-manager/tests/frontend/SftpTransferTab.test.tsx index da98fa81c..af83eb617 100644 --- a/plugins/file-manager/tests/frontend/SftpTransferTab.test.tsx +++ b/plugins/file-manager/tests/frontend/SftpTransferTab.test.tsx @@ -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()), + useTranslation: () => ({ t: (key: string) => key, language: "en" }), useSettings: () => ({ values: { confirmBeforeTrash: api.confirmBeforeTrash }, }), diff --git a/plugins/file-manager/tests/frontend/components/download-progress.test.tsx b/plugins/file-manager/tests/frontend/components/download-progress.test.tsx index 67bcdde94..dcc443fcf 100644 --- a/plugins/file-manager/tests/frontend/components/download-progress.test.tsx +++ b/plugins/file-manager/tests/frontend/components/download-progress.test.tsx @@ -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()), useTranslation: () => ({ t: (key: string, params?: { name?: string }) => params?.name ? `${key}: ${params.name}` : key, }), - initReactI18next: { type: "3rdParty", init: () => {} }, })); vi.mock("../../../src/frontend/components/WindowManager", () => ({ useWindowManager: () => ({ diff --git a/plugins/session-sharing/locales/en.json b/plugins/session-sharing/locales/en.json index 110b1dd38..47931c5a6 100644 --- a/plugins/session-sharing/locales/en.json +++ b/plugins/session-sharing/locales/en.json @@ -121,6 +121,7 @@ "linkInvalid": "This guest link is invalid or the meeting has ended" }, "reopenFromPanel": "This meeting tab expired. Reopen the room from the Meetings panel.", + "retry": "Retry", "requestControl": "Request control", "cancelControlRequest": "Cancel request", "controlQueue": "Control requests", diff --git a/plugins/session-sharing/src/frontend/CollabRoomTab.tsx b/plugins/session-sharing/src/frontend/CollabRoomTab.tsx index 55643207d..2fc07dbb0 100644 --- a/plugins/session-sharing/src/frontend/CollabRoomTab.tsx +++ b/plugins/session-sharing/src/frontend/CollabRoomTab.tsx @@ -533,7 +533,7 @@ export function CollabRoomTab({

{loadError}

@@ -562,7 +562,7 @@ export function CollabRoomTab({ {loadError} )}