ELECTRON-519: support Japanese localization for menus, dialogs and windows (#401)

- add basic localisation implementation for menu items
- add more strings to support localisation on menus
- add more strings to support localisation on menus
- add all menu items for localisation
- refactor i18n code
- Add localization for screen picker, basic auth and notification settings child windows
- Add localization bridge
- add i18n support to more strings
- update translations
- add events to change language and redo menu template
- move config update logic to windowMgr
- fix linting issues and refactor
- add snipping tool messages
This commit is contained in:
Vishwas Shashidhar
2018-06-19 20:26:04 +05:30
committed by GitHub
parent fd39d680a0
commit a26a1d609c
23 changed files with 859 additions and 295 deletions

View File

@@ -142,12 +142,13 @@ electron.ipcMain.on(apiName, (event, arg) => {
openScreenPickerWindow(event.sender, arg.sources, arg.id);
}
break;
case apiCmds.popupMenu:
var browserWin = electron.BrowserWindow.fromWebContents(event.sender);
case apiCmds.popupMenu: {
let browserWin = electron.BrowserWindow.fromWebContents(event.sender);
if (browserWin && !browserWin.isDestroyed()) {
windowMgr.getMenu().popup(browserWin, { x: 20, y: 15, async: true });
windowMgr.getMenu().popup(browserWin, {x: 20, y: 15, async: true});
}
break;
}
case apiCmds.optimizeMemoryConsumption:
if (typeof arg.memory === 'object' && typeof arg.cpuUsage === 'object' && typeof arg.memory.workingSetSize === 'number') {
optimizeMemory(arg.memory, arg.cpuUsage);
@@ -158,6 +159,11 @@ electron.ipcMain.on(apiName, (event, arg) => {
setIsInMeeting(arg.isInMeeting);
}
break;
case apiCmds.setLocale:
if (typeof arg.locale === 'string') {
eventEmitter.emit('language-changed', { language: arg.locale });
}
break;
default:
}