diff --git a/src/locales/de/translation.json b/src/locales/de/translation.json index 2c9c4207..3d9e65d6 100644 --- a/src/locales/de/translation.json +++ b/src/locales/de/translation.json @@ -1571,5 +1571,28 @@ "cpu": "CPU", "ram": "RAM", "notAvailable": "Nicht verfügbar" + }, + "commandPalette": { + "searchPlaceholder": "Nach Hosts oder Schnellaktionen suchen...", + "recentActivity": "Kürzliche Aktivität", + "navigation": "Navigation", + "addHost": "Host hinzufügen", + "addCredential": "Anmeldedaten hinzufügen", + "adminSettings": "Admin-Einstellungen", + "userProfile": "Benutzerprofil", + "updateLog": "Aktualisierungsprotokoll", + "hosts": "Hosts", + "openServerDetails": "Serverdetails öffnen", + "openFileManager": "Dateimanager öffnen", + "edit": "Bearbeiten", + "links": "Links", + "github": "GitHub", + "support": "Support", + "discord": "Discord", + "donate": "Spenden", + "press": "Drücken Sie", + "toToggle": "zum Umschalten", + "close": "Schließen", + "hostManager": "Host-Manager" } } diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 853d5ae6..213bdc06 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -1689,5 +1689,28 @@ "cpu": "CPU", "ram": "RAM", "notAvailable": "N/A" + }, + "commandPalette": { + "searchPlaceholder": "Search for hosts or quick actions...", + "recentActivity": "Recent Activity", + "navigation": "Navigation", + "addHost": "Add Host", + "addCredential": "Add Credential", + "adminSettings": "Admin Settings", + "userProfile": "User Profile", + "updateLog": "Update Log", + "hosts": "Hosts", + "openServerDetails": "Open Server Details", + "openFileManager": "Open File Manager", + "edit": "Edit", + "links": "Links", + "github": "GitHub", + "support": "Support", + "discord": "Discord", + "donate": "Donate", + "press": "Press", + "toToggle": "to toggle", + "close": "Close", + "hostManager": "Host Manager" } } diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json index 1f3fb9bd..f641414e 100644 --- a/src/locales/ru/translation.json +++ b/src/locales/ru/translation.json @@ -1657,5 +1657,28 @@ "cpu": "CPU", "ram": "RAM", "notAvailable": "N/A" + }, + "commandPalette": { + "searchPlaceholder": "Поиск хостов или быстрых действий...", + "recentActivity": "Недавняя активность", + "navigation": "Навигация", + "addHost": "Добавить хост", + "addCredential": "Добавить учетные данные", + "adminSettings": "Настройки администратора", + "userProfile": "Профиль пользователя", + "updateLog": "Журнал обновлений", + "hosts": "Хосты", + "openServerDetails": "Открыть детали сервера", + "openFileManager": "Открыть файловый менеджер", + "edit": "Редактировать", + "links": "Ссылки", + "github": "GitHub", + "support": "Поддержка", + "discord": "Discord", + "donate": "Пожертвовать", + "press": "Нажмите", + "toToggle": "для переключения", + "close": "Закрыть", + "hostManager": "Менеджер хостов" } } diff --git a/src/locales/zh/translation.json b/src/locales/zh/translation.json index bac2f366..bdeb9d57 100644 --- a/src/locales/zh/translation.json +++ b/src/locales/zh/translation.json @@ -1582,5 +1582,28 @@ "cpu": "CPU", "ram": "内存", "notAvailable": "不可用" + }, + "commandPalette": { + "searchPlaceholder": "搜索主机或快速操作...", + "recentActivity": "最近活动", + "navigation": "导航", + "addHost": "添加主机", + "addCredential": "添加凭据", + "adminSettings": "管理员设置", + "userProfile": "用户资料", + "updateLog": "更新日志", + "hosts": "主机", + "openServerDetails": "打开服务器详情", + "openFileManager": "打开文件管理器", + "edit": "编辑", + "links": "链接", + "github": "GitHub", + "support": "支持", + "discord": "Discord", + "donate": "捐赠", + "press": "按下", + "toToggle": "来切换", + "close": "关闭", + "hostManager": "主机管理器" } } diff --git a/src/ui/desktop/apps/command-palette/CommandPalette.tsx b/src/ui/desktop/apps/command-palette/CommandPalette.tsx index 1833aa1d..64871062 100644 --- a/src/ui/desktop/apps/command-palette/CommandPalette.tsx +++ b/src/ui/desktop/apps/command-palette/CommandPalette.tsx @@ -20,6 +20,7 @@ import { Pencil, EllipsisVertical, } from "lucide-react"; +import { useTranslation } from "react-i18next"; import { BiMoney, BiSupport } from "react-icons/bi"; import { BsDiscord } from "react-icons/bs"; import { GrUpdate } from "react-icons/gr"; @@ -64,6 +65,7 @@ export function CommandPalette({ isOpen: boolean; setIsOpen: (isOpen: boolean) => void; }) { + const { t } = useTranslation(); const inputRef = useRef(null); const { addTab, setCurrentTab, tabs: tabList, updateTab } = useTabs(); const [recentActivity, setRecentActivity] = useState( @@ -91,7 +93,7 @@ export function CommandPalette({ } else { const id = addTab({ type: "ssh_manager", - title: "Host Manager", + title: t("commandPalette.hostManager"), initialTab: "add_host", }); setCurrentTab(id); @@ -107,7 +109,7 @@ export function CommandPalette({ } else { const id = addTab({ type: "ssh_manager", - title: "Host Manager", + title: t("commandPalette.hostManager"), initialTab: "add_credential", }); setCurrentTab(id); @@ -120,7 +122,7 @@ export function CommandPalette({ if (adminTab) { setCurrentTab(adminTab.id); } else { - const id = addTab({ type: "admin", title: "Admin Settings" }); + const id = addTab({ type: "admin", title: t("commandPalette.adminSettings") }); setCurrentTab(id); } setIsOpen(false); @@ -131,7 +133,7 @@ export function CommandPalette({ if (userProfileTab) { setCurrentTab(userProfileTab.id); } else { - const id = addTab({ type: "user_profile", title: "User Profile" }); + const id = addTab({ type: "user_profile", title: t("commandPalette.userProfile") }); setCurrentTab(id); } setIsOpen(false); @@ -214,7 +216,7 @@ export function CommandPalette({ : `${host.username}@${host.ip}:${host.port}`; addTab({ type: "ssh_manager", - title: "Host Manager", + title: t("commandPalette.hostManager"), hostConfig: host, initialTab: "add_host", }); @@ -235,7 +237,7 @@ export function CommandPalette({ > {recentActivity.length > 0 && ( <> - + {recentActivity.map((item, index) => ( )} - + - Add Host + {t("commandPalette.addHost")} - Add Credential + {t("commandPalette.addCredential")} - Admin Settings + {t("commandPalette.adminSettings")} - User Profile + {t("commandPalette.userProfile")} - Update Log + {t("commandPalette.updateLog")} - + {hosts.map((host, index) => { const title = host.name?.trim() ? host.name @@ -329,7 +331,7 @@ export function CommandPalette({ className="flex items-center gap-2 cursor-pointer px-3 py-2 hover:bg-dark-hover text-gray-300" > - Open Server Details + {t("commandPalette.openServerDetails")} { @@ -339,7 +341,7 @@ export function CommandPalette({ className="flex items-center gap-2 cursor-pointer px-3 py-2 hover:bg-dark-hover text-gray-300" > - Open File Manager + {t("commandPalette.openFileManager")} { @@ -349,7 +351,7 @@ export function CommandPalette({ className="flex items-center gap-2 cursor-pointer px-3 py-2 hover:bg-dark-hover text-gray-300" > - Edit + {t("commandPalette.edit")} @@ -359,36 +361,36 @@ export function CommandPalette({ })} - + - GitHub + {t("commandPalette.github")} - Support + {t("commandPalette.support")} - Discord + {t("commandPalette.discord")} - Donate + {t("commandPalette.donate")}
- Press + {t("commandPalette.press")} Shift Shift - to toggle + {t("commandPalette.toToggle")}
- Close + {t("commandPalette.close")} Esc