feat(desktop): i18n for tauri side

This commit is contained in:
adamelmore
2026-01-27 15:00:17 -06:00
parent acf0df1e98
commit 51edf68606
8 changed files with 204 additions and 28 deletions

View File

@@ -1,13 +1,15 @@
import { invoke } from "@tauri-apps/api/core"
import { message } from "@tauri-apps/plugin-dialog"
import { initI18n, t } from "./i18n"
export async function installCli(): Promise<void> {
await initI18n()
try {
const path = await invoke<string>("install_cli")
await message(`CLI installed to ${path}\n\nRestart your terminal to use the 'opencode' command.`, {
title: "CLI Installed",
})
await message(t("desktop.cli.installed.message", { path }), { title: t("desktop.cli.installed.title") })
} catch (e) {
await message(`Failed to install CLI: ${e}`, { title: "Installation Failed" })
await message(t("desktop.cli.failed.message", { error: String(e) }), { title: t("desktop.cli.failed.title") })
}
}