Forgot to add locale

*I'm really starting to hate typescript*
This commit is contained in:
Core 2022-01-30 17:13:53 +00:00
parent a535ec0a8a
commit 3d90479cba
No known key found for this signature in database
GPG key ID: FE9BF1B547F8F3C6
3 changed files with 21 additions and 6 deletions

View file

@ -14,6 +14,7 @@ export class AppEvents {
private store: any = undefined;
private win: any = undefined;
private tray: any = undefined;
private i18n: any = undefined;
constructor(store: any) {
this.store = store
@ -112,8 +113,9 @@ export class AppEvents {
console.log('[AppEvents] App ready');
}
public bwCreated(win: Electron.BrowserWindow) {
public bwCreated(win: Electron.BrowserWindow, i18n: any) {
this.win = win
this.i18n = i18n
electron.app.on('open-url', (event, url) => {
event.preventDefault()
@ -226,6 +228,7 @@ export class AppEvents {
height: 20
}),
}
console.log(this.i18n)
this.tray = new electron.Tray(process.platform === 'win32' ? icons.win32 : (process.platform === 'darwin' ? icons.darwin : icons.linux))
this.tray.setToolTip(electron.app.getName())
@ -266,7 +269,7 @@ export class AppEvents {
const menu = electron.Menu.buildFromTemplate([
{
label: (visible ? 'Minimize to Tray' : `Show ${electron.app.getName()}`),
label: (visible ? this.i18n['action.tray.minimize'] : `${this.i18n['action.tray.show']} ${electron.app.getName()}`),
click: () => {
if (this.win) {
if (visible) {
@ -278,7 +281,7 @@ export class AppEvents {
}
},
{
label: 'Quit',
label: this.i18n['action.tray.quit'],
click: () => {
electron.app.quit()
}