Skip to content

Commit 875cd5c

Browse files
committed
fix(neuron-wallet): set the language on app ready
1. the app.getLocale method should be called after app.ready. 2. generate the application menu template dynamically on updating so it always has the latest status.
1 parent 71a4d61 commit 875cd5c

File tree

3 files changed

+233
-227
lines changed

3 files changed

+233
-227
lines changed

packages/neuron-wallet/src/main.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { app } from 'electron'
21
import 'reflect-metadata'
32
import { debounceTime } from 'rxjs/operators'
43

@@ -10,6 +9,8 @@ import initConnection from 'database/address/ormconfig'
109
import WalletsService from 'services/wallets'
1110
import { WalletListSubject, CurrentWalletSubject } from 'models/subjects/wallets'
1211
import dataUpdateSubject from 'models/subjects/data-update'
12+
import app from 'app'
13+
import { changeLanguage } from 'utils/i18n'
1314

1415
const walletsService = WalletsService.getInstance()
1516

@@ -29,6 +30,8 @@ const openWindow = () => {
2930
}
3031

3132
app.on('ready', async () => {
33+
changeLanguage(app.getLocale())
34+
3235
WalletListSubject.pipe(debounceTime(50)).subscribe(({ currentWallet = null, currentWalletList = [] }) => {
3336
const walletList = currentWalletList.map(({ id, name }) => ({ id, name }))
3437
const currentWalletId = currentWallet ? currentWallet.id : null

0 commit comments

Comments
 (0)