INNER CODE UNIT · TypeScript
isZh
op7418/CodePilot · electron/main.ts:663
const isZh = (() => {
try { return app.getLocale().toLowerCase().startsWith('zh'); } catch { return false; }
})();
const locale: Locale = isZh ? 'zh' : 'en';
try {
const result = await dialog.showMessageBox(mainWindow ?? undefined, {
type: 'warning',
title: translate(locale, 'cliMaintenance.quit.title'),
message: translate(locale, 'cliMaintenance.quit.message'),
detail: translate(locale, 'cliMaintenance.quit.detail'),
buttons: [
translate(locale, 'cliMaintenance.quit.keepWaiting'),
translate(locale, 'cliMaintenance.quit.cancelAndQuit'),
translate(locale, 'cliMaintenance.quit.forceQuit'),
],
defaultId: 0,
cancelId: 0,
noLink: true,