Skip to content

Commit 664ccc8

Browse files
committed
fix(neuron-wallet): enable the i18n and update the wallet label of the application menu
1 parent 5b20d64 commit 664ccc8

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/neuron-wallet/src/main.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { app } from 'electron'
22
import 'reflect-metadata'
33
import { debounceTime } from 'rxjs/operators'
44

5-
import i18n from 'utils/i18n'
65
import { updateApplicationMenu } from 'utils/application-menu'
76
import WindowManager from 'models/window-manager'
87
import createMainWindow from 'startup/create-main-window'
@@ -44,7 +43,6 @@ app.on('ready', async () => {
4443
}
4544
})
4645

47-
i18n.changeLanguage(['zh', 'zh-CN'].includes(app.getLocale()) ? 'zh' : 'en')
4846
const wallets = walletsService.getAll()
4947
const currentWallet = walletsService.getCurrent()
5048

packages/neuron-wallet/src/utils/application-menu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const appMenuItem: MenuItemConstructorOptions = {
5858

5959
export const walletMenuItem: MenuItemConstructorOptions = {
6060
id: 'wallet',
61-
label: 'Wallet',
61+
label: i18n.t('application-menu.wallet.label'),
6262
submenu: [
6363
{ id: 'select', label: i18n.t('application-menu.wallet.select'), submenu: [] },
6464
{

packages/neuron-wallet/src/utils/i18n.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import i18n from 'i18next'
22
import zh from 'locales/zh'
33
import en from 'locales/en'
4+
import app from 'app'
45

56
if (!i18n.isInitialized) {
7+
const fallbackLng = ['zh', 'zh-CN'].includes(app.getLocale()) ? 'zh' : 'en'
68
i18n.init({
79
resources: {
810
en,
911
zh,
1012
},
11-
fallbackLng: 'en',
13+
fallbackLng,
1214
interpolation: {
1315
escapeValue: false,
1416
},

0 commit comments

Comments
 (0)