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

@@ -5,10 +5,13 @@ import { relaunch } from "@tauri-apps/plugin-process"
import { runUpdater, UPDATER_ENABLED } from "./updater"
import { installCli } from "./cli"
import { initI18n, t } from "./i18n"
export async function createMenu() {
if (ostype() !== "macos") return
await initI18n()
const menu = await Menu.new({
items: [
await Submenu.new({
@@ -20,22 +23,22 @@ export async function createMenu() {
await MenuItem.new({
enabled: UPDATER_ENABLED,
action: () => runUpdater({ alertOnFail: true }),
text: "Check For Updates...",
text: t("desktop.menu.checkForUpdates"),
}),
await MenuItem.new({
action: () => installCli(),
text: "Install CLI...",
text: t("desktop.menu.installCli"),
}),
await MenuItem.new({
action: async () => window.location.reload(),
text: "Reload Webview",
text: t("desktop.menu.reloadWebview"),
}),
await MenuItem.new({
action: async () => {
await invoke("kill_sidecar").catch(() => undefined)
await relaunch().catch(() => undefined)
},
text: "Restart",
text: t("desktop.menu.restart"),
}),
await PredefinedMenuItem.new({
item: "Separator",