diff --git a/packages/ui/src/components/bottom-bar.tsx b/packages/ui/src/components/bottom-bar.tsx index f73ace4..ad5beb0 100644 --- a/packages/ui/src/components/bottom-bar.tsx +++ b/packages/ui/src/components/bottom-bar.tsx @@ -1,6 +1,7 @@ import { Play, User, XIcon } from "lucide-react"; import { useCallback, useState } from "react"; import { toast } from "sonner"; +import { useI18n } from "@/lib/i18n"; import { cn } from "@/lib/utils"; import { useAuthStore } from "@/models/auth"; import { useGameStore } from "@/models/game"; @@ -18,6 +19,7 @@ import { import { Spinner } from "./ui/spinner"; export function BottomBar() { + const { t } = useI18n(); const account = useAuthStore((state) => state.account); const { instances, activeInstance, setActiveInstance } = useInstanceStore(); @@ -48,15 +50,15 @@ export function BottomBar() { await setActiveInstance(nextInstance); } catch (error) { console.error("Failed to activate instance:", error); - toast.error(`Failed to activate instance: ${String(error)}`); + toast.error(t("bottom.activateFailed", { error: String(error) })); } }, - [activeInstance?.id, instances, setActiveInstance], + [activeInstance?.id, instances, setActiveInstance, t], ); const handleStartGame = async () => { if (!activeInstance) { - toast.info("Please select an instance first!"); + toast.info(t("bottom.selectInstanceFirst")); return; } @@ -77,7 +79,7 @@ export function BottomBar() { size="lg" onClick={() => setShowLoginModal(true)} > - Login + {t("bottom.login")} ); } @@ -90,7 +92,7 @@ export function BottomBar() { disabled={stoppingInstanceId !== null} > {stoppingInstanceId ? : } - Close + {t("bottom.close")} ); } @@ -106,7 +108,7 @@ export function BottomBar() { disabled={launchingInstanceId === activeInstance?.id} > {launchingInstanceId === activeInstance?.id ? : } - Start + {t("bottom.start")} ); }; @@ -133,8 +135,8 @@ export function BottomBar() { @@ -145,7 +147,7 @@ export function BottomBar() {
{instance.name} - {instance.versionId ?? "No version selected"} + {instance.versionId ?? t("bottom.noVersion")}
diff --git a/packages/ui/src/components/config-editor.tsx b/packages/ui/src/components/config-editor.tsx index 129b8f7..b76570c 100644 --- a/packages/ui/src/components/config-editor.tsx +++ b/packages/ui/src/components/config-editor.tsx @@ -1,6 +1,7 @@ import type React from "react"; import { useEffect, useState } from "react"; import { type ZodType, z } from "zod"; +import { useI18n } from "@/lib/i18n"; import { useSettingsStore } from "@/models/settings"; import type { LauncherConfig } from "@/types"; import { Button } from "./ui/button"; @@ -43,6 +44,7 @@ export interface ConfigEditorProps } export function ConfigEditor({ onOpenChange, ...props }: ConfigEditorProps) { + const { t } = useI18n(); const settings = useSettingsStore(); const [errorMessage, setErrorMessage] = useState(null); @@ -76,10 +78,8 @@ export function ConfigEditor({ onOpenChange, ...props }: ConfigEditorProps) { - Edit Configuration - - Edit the raw JSON configuration file. - + {t("config.title")} + {t("config.desc")}