дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-04 17:21:13 +02:00
When the global settings.toml is missing, OpenIDEA now saves the OS's preferred UI language (NSLocale on macOS, GetUserPreferredUILanguages on Windows, LC_ALL/LC_MESSAGES/LANG elsewhere) as appearance.locale, mapped to one of the shipped UI languages with English as the fallback, and loads that catalog before the workbench renders. An existing settings file keeps its saved language. The mapping lives in ide-workspace next to the settings store, and a test keeps its locale list in step with the frontend's. Co-authored-by: laot7490 <[email protected]>
39 рядки
1.6 KiB
TypeScript
39 рядки
1.6 KiB
TypeScript
import { activateFeatures } from "./features";
|
|
import { setLocale } from "./platform/i18n";
|
|
import { isTauri } from "./platform/ipc";
|
|
import { installKeyboardDispatcher } from "./platform/keymap";
|
|
import { loadSettings, useProject } from "./platform/project";
|
|
import { mountWindowRoot } from "./windowBoot";
|
|
import { activateWorkbench } from "./workbench/activate";
|
|
import { installFullscreenEscapeGuard } from "./workbench/fullscreenEscape";
|
|
import { Workbench } from "./workbench/Workbench";
|
|
|
|
export async function bootWorkbenchWindow(): Promise<void> {
|
|
if (isTauri()) {
|
|
try {
|
|
await loadSettings();
|
|
await setLocale(useProject.getState().settings?.appearance?.locale);
|
|
} catch (error) {
|
|
console.warn("cannot load startup settings", error);
|
|
}
|
|
}
|
|
// Before the features' and the dispatcher's key handlers: it wraps the Escape they see.
|
|
installFullscreenEscapeGuard();
|
|
activateWorkbench();
|
|
// `vite build --mode perf` is a production bundle for the performance harness (`perf/`).
|
|
const perfBuild = import.meta.env.MODE === "perf";
|
|
if ((import.meta.env.DEV || perfBuild) && !isTauri()) {
|
|
const { registerDevSamples } = await import("./workbench/devSamples");
|
|
registerDevSamples();
|
|
}
|
|
if (import.meta.env.DEV || perfBuild) {
|
|
const { installPerfProbe } = await import("./workbench/perfProbe");
|
|
installPerfProbe();
|
|
}
|
|
// Order matters: features (e.g. the terminal) install capture-phase key handlers
|
|
// that must run before the global dispatcher.
|
|
activateFeatures();
|
|
installKeyboardDispatcher();
|
|
mountWindowRoot(Workbench, { prefetchLazy: true });
|
|
}
|