diff --git a/packages/neuron-wallet/src/main.ts b/packages/neuron-wallet/src/main.ts index fe4f0e065c..735a59630f 100644 --- a/packages/neuron-wallet/src/main.ts +++ b/packages/neuron-wallet/src/main.ts @@ -2,7 +2,6 @@ import { app } from 'electron' import 'reflect-metadata' import { debounceTime } from 'rxjs/operators' -import i18n from 'utils/i18n' import { updateApplicationMenu } from 'utils/application-menu' import WindowManager from 'models/window-manager' import createMainWindow from 'startup/create-main-window' @@ -44,7 +43,6 @@ app.on('ready', async () => { } }) - i18n.changeLanguage(['zh', 'zh-CN'].includes(app.getLocale()) ? 'zh' : 'en') const wallets = walletsService.getAll() const currentWallet = walletsService.getCurrent() diff --git a/packages/neuron-wallet/src/utils/application-menu.ts b/packages/neuron-wallet/src/utils/application-menu.ts index 43fd4e7e40..7cdbeba0f0 100644 --- a/packages/neuron-wallet/src/utils/application-menu.ts +++ b/packages/neuron-wallet/src/utils/application-menu.ts @@ -58,7 +58,7 @@ export const appMenuItem: MenuItemConstructorOptions = { export const walletMenuItem: MenuItemConstructorOptions = { id: 'wallet', - label: 'Wallet', + label: i18n.t('application-menu.wallet.label'), submenu: [ { id: 'select', label: i18n.t('application-menu.wallet.select'), submenu: [] }, { diff --git a/packages/neuron-wallet/src/utils/i18n.ts b/packages/neuron-wallet/src/utils/i18n.ts index 19d998d2fa..ea5836f49a 100644 --- a/packages/neuron-wallet/src/utils/i18n.ts +++ b/packages/neuron-wallet/src/utils/i18n.ts @@ -1,14 +1,16 @@ import i18n from 'i18next' import zh from 'locales/zh' import en from 'locales/en' +import app from 'app' if (!i18n.isInitialized) { + const fallbackLng = ['zh', 'zh-CN'].includes(app.getLocale()) ? 'zh' : 'en' i18n.init({ resources: { en, zh, }, - fallbackLng: 'en', + fallbackLng, interpolation: { escapeValue: false, },