Make all OS menus localizable

Turns out that Electron is not localizing the 'role' elements like we
expected would happen.
pull/1/head
Scott Nonnenberg 7 years ago
parent 1f02d411a1
commit 4415293100

@ -27,6 +27,98 @@
"message": "Preferences…", "message": "Preferences…",
"description": "The label that is used for the Preferences menu in the program main menu. This should be consistent with the standard naming for Preferences on the operating system." "description": "The label that is used for the Preferences menu in the program main menu. This should be consistent with the standard naming for Preferences on the operating system."
}, },
"appMenuHide": {
"message": "Hide",
"description": "Application menu command to hide the window"
},
"appMenuHideOthers": {
"message": "Hide Others",
"description": "Application menu command to hide all other windows"
},
"appMenuUnhide": {
"message": "Show All",
"description": "Application menu command to show all application windows"
},
"appMenuQuit": {
"message": "Quit Signal",
"description": "Application menu command to close the application"
},
"editMenuUndo": {
"message": "Undo",
"description": "Edit menu command to remove recently-typed text"
},
"editMenuRedo": {
"message": "Redo",
"description": "Edit menu command to restore previously undone typed text"
},
"editMenuCut": {
"message": "Cut",
"description": "Edit menu command to remove selected text and add it to clipboard"
},
"editMenuCopy": {
"message": "Copy",
"description": "Edit menu command to add selected text to clipboard"
},
"editMenuPaste": {
"message": "Paste",
"description": "Edit menu command to insert text from clipboard at cursor location"
},
"editMenuPasteAndMatchStyle": {
"message": "Paste and Match Style",
"description": "Edit menu command to insert text from clipboard at cursor location, taking only text and not style information"
},
"editMenuDelete": {
"message": "Delete",
"description": "Edit menu command to remove the selected text"
},
"editMenuSelectAll": {
"message": "Select All",
"description": "Edit menu comand to select all of the text in selected text box"
},
"editMenuStartSpeaking": {
"message": "Start speaking",
"description": "Edit menu item under 'speech' to start dictation"
},
"editMenuStopSpeaking": {
"message": "Stop speaking",
"description": "Edit menu item under 'speech' to stop dictation"
},
"windowMenuClose": {
"message": "Close Window",
"description": "Window menu command to close the current window"
},
"windowMenuMinimize": {
"message": "Minimize",
"description": "Window menu command to minimize the current window"
},
"windowMenuZoom": {
"message": "Zoom",
"description": "Window menu command to make the current window the size of the whole screen"
},
"windowMenuBringAllToFront": {
"message": "Bring All to Front",
"description": "Window menu command to bring all windows of current applicatinon to front"
},
"viewMenuResetZoom": {
"message": "Actual Size",
"description": "View menu command to go back to the default zoom"
},
"viewMenuZoomIn": {
"message": "Zoom In",
"description": "View menu command to make everything bigger"
},
"viewMenuZoomOut": {
"message": "Zoom Out",
"description": "View menu command to make everything smaller"
},
"viewMenuToggleFullScreen": {
"message": "Toggle Full Screen",
"description": "View menu command to enter or leave Full Screen mode"
},
"viewMenuToggleDevTools": {
"message": "Toggle Developer Tools",
"description": "View menu command to show or hide the developer tools"
},
"menuSetupWithImport": { "menuSetupWithImport": {
"message": "Set Up with Import", "message": "Set Up with Import",
"description": "When the application is not yet set up, menu option to start up the import sequence" "description": "When the application is not yet set up, menu option to start up the import sequence"

@ -33,6 +33,7 @@ exports.createTemplate = (options, messages) => {
}, },
{ {
role: 'quit', role: 'quit',
label: messages.appMenuQuit.message,
}, },
], ],
}, },
@ -41,30 +42,38 @@ exports.createTemplate = (options, messages) => {
submenu: [ submenu: [
{ {
role: 'undo', role: 'undo',
label: messages.editMenuUndo.message,
}, },
{ {
role: 'redo', role: 'redo',
label: messages.editMenuRedo.message,
}, },
{ {
type: 'separator', type: 'separator',
}, },
{ {
role: 'cut', role: 'cut',
label: messages.editMenuCut.message,
}, },
{ {
role: 'copy', role: 'copy',
label: messages.editMenuCopy.message,
}, },
{ {
role: 'paste', role: 'paste',
label: messages.editMenuPaste.message,
}, },
{ {
role: 'pasteandmatchstyle', role: 'pasteandmatchstyle',
label: messages.editMenuPasteAndMatchStyle.message,
}, },
{ {
role: 'delete', role: 'delete',
label: messages.editMenuDelete.message,
}, },
{ {
role: 'selectall', role: 'selectall',
label: messages.editMenuSelectAll.message,
}, },
], ],
}, },
@ -73,18 +82,22 @@ exports.createTemplate = (options, messages) => {
submenu: [ submenu: [
{ {
role: 'resetzoom', role: 'resetzoom',
label: messages.viewMenuResetZoom.message,
}, },
{ {
role: 'zoomin', role: 'zoomin',
label: messages.viewMenuZoomIn.message,
}, },
{ {
role: 'zoomout', role: 'zoomout',
label: messages.viewMenuZoomOut.message,
}, },
{ {
type: 'separator', type: 'separator',
}, },
{ {
role: 'togglefullscreen', role: 'togglefullscreen',
label: messages.viewMenuToggleFullScreen.message,
}, },
{ {
type: 'separator', type: 'separator',
@ -98,6 +111,7 @@ exports.createTemplate = (options, messages) => {
}, },
{ {
role: 'toggledevtools', role: 'toggledevtools',
label: messages.viewMenuToggleDevTools.message,
}, },
], ],
}, },
@ -107,6 +121,7 @@ exports.createTemplate = (options, messages) => {
submenu: [ submenu: [
{ {
role: 'minimize', role: 'minimize',
label: messages.windowMenuMinimize.message,
}, },
], ],
}, },
@ -239,18 +254,22 @@ function updateForMac(template, messages, options) {
type: 'separator', type: 'separator',
}, },
{ {
label: messages.appMenuHide.message,
role: 'hide', role: 'hide',
}, },
{ {
label: messages.appMenuHideOthers.message,
role: 'hideothers', role: 'hideothers',
}, },
{ {
label: messages.appMenuUnhide.message,
role: 'unhide', role: 'unhide',
}, },
{ {
type: 'separator', type: 'separator',
}, },
{ {
label: messages.appMenuQuit.message,
role: 'quit', role: 'quit',
}, },
], ],
@ -267,9 +286,11 @@ function updateForMac(template, messages, options) {
submenu: [ submenu: [
{ {
role: 'startspeaking', role: 'startspeaking',
label: messages.editMenuStartSpeaking.message,
}, },
{ {
role: 'stopspeaking', role: 'stopspeaking',
label: messages.editMenuStopSpeaking.message,
}, },
], ],
} }
@ -280,14 +301,17 @@ function updateForMac(template, messages, options) {
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
template[windowMenuTemplateIndex].submenu = [ template[windowMenuTemplateIndex].submenu = [
{ {
label: messages.windowMenuClose.message,
accelerator: 'CmdOrCtrl+W', accelerator: 'CmdOrCtrl+W',
role: 'close', role: 'close',
}, },
{ {
label: messages.windowMenuMinimize.message,
accelerator: 'CmdOrCtrl+M', accelerator: 'CmdOrCtrl+M',
role: 'minimize', role: 'minimize',
}, },
{ {
label: messages.windowMenuZoom.message,
role: 'zoom', role: 'zoom',
}, },
{ {
@ -299,6 +323,7 @@ function updateForMac(template, messages, options) {
}, },
{ {
role: 'front', role: 'front',
label: messages.windowMenuBringAllToFront.message,
}, },
]; ];

@ -17,18 +17,22 @@
"type": "separator" "type": "separator"
}, },
{ {
"label": "Hide",
"role": "hide" "role": "hide"
}, },
{ {
"label": "Hide Others",
"role": "hideothers" "role": "hideothers"
}, },
{ {
"label": "Show All",
"role": "unhide" "role": "unhide"
}, },
{ {
"type": "separator" "type": "separator"
}, },
{ {
"label": "Quit Signal",
"role": "quit" "role": "quit"
} }
] ]
@ -50,30 +54,38 @@
"label": "&Edit", "label": "&Edit",
"submenu": [ "submenu": [
{ {
"label": "Undo",
"role": "undo" "role": "undo"
}, },
{ {
"label": "Redo",
"role": "redo" "role": "redo"
}, },
{ {
"type": "separator" "type": "separator"
}, },
{ {
"label": "Cut",
"role": "cut" "role": "cut"
}, },
{ {
"label": "Copy",
"role": "copy" "role": "copy"
}, },
{ {
"label": "Paste",
"role": "paste" "role": "paste"
}, },
{ {
"label": "Paste and Match Style",
"role": "pasteandmatchstyle" "role": "pasteandmatchstyle"
}, },
{ {
"label": "Delete",
"role": "delete" "role": "delete"
}, },
{ {
"label": "Select All",
"role": "selectall" "role": "selectall"
}, },
{ {
@ -83,9 +95,11 @@
"label": "Speech", "label": "Speech",
"submenu": [ "submenu": [
{ {
"label": "Start speaking",
"role": "startspeaking" "role": "startspeaking"
}, },
{ {
"label": "Stop speaking",
"role": "stopspeaking" "role": "stopspeaking"
} }
] ]
@ -96,18 +110,22 @@
"label": "&View", "label": "&View",
"submenu": [ "submenu": [
{ {
"label": "Actual Size",
"role": "resetzoom" "role": "resetzoom"
}, },
{ {
"label": "Zoom In",
"role": "zoomin" "role": "zoomin"
}, },
{ {
"label": "Zoom Out",
"role": "zoomout" "role": "zoomout"
}, },
{ {
"type": "separator" "type": "separator"
}, },
{ {
"label": "Toggle Full Screen",
"role": "togglefullscreen" "role": "togglefullscreen"
}, },
{ {
@ -121,6 +139,7 @@
"type": "separator" "type": "separator"
}, },
{ {
"label": "Toggle Developer Tools",
"role": "toggledevtools" "role": "toggledevtools"
} }
] ]
@ -130,14 +149,17 @@
"role": "window", "role": "window",
"submenu": [ "submenu": [
{ {
"label": "Close Window",
"accelerator": "CmdOrCtrl+W", "accelerator": "CmdOrCtrl+W",
"role": "close" "role": "close"
}, },
{ {
"label": "Minimize",
"accelerator": "CmdOrCtrl+M", "accelerator": "CmdOrCtrl+M",
"role": "minimize" "role": "minimize"
}, },
{ {
"label": "Zoom",
"role": "zoom" "role": "zoom"
}, },
{ {
@ -148,6 +170,7 @@
"type": "separator" "type": "separator"
}, },
{ {
"label": "Bring All to Front",
"role": "front" "role": "front"
} }
] ]

@ -17,18 +17,22 @@
"type": "separator" "type": "separator"
}, },
{ {
"label": "Hide",
"role": "hide" "role": "hide"
}, },
{ {
"label": "Hide Others",
"role": "hideothers" "role": "hideothers"
}, },
{ {
"label": "Show All",
"role": "unhide" "role": "unhide"
}, },
{ {
"type": "separator" "type": "separator"
}, },
{ {
"label": "Quit Signal",
"role": "quit" "role": "quit"
} }
] ]
@ -37,30 +41,38 @@
"label": "&Edit", "label": "&Edit",
"submenu": [ "submenu": [
{ {
"label": "Undo",
"role": "undo" "role": "undo"
}, },
{ {
"label": "Redo",
"role": "redo" "role": "redo"
}, },
{ {
"type": "separator" "type": "separator"
}, },
{ {
"label": "Cut",
"role": "cut" "role": "cut"
}, },
{ {
"label": "Copy",
"role": "copy" "role": "copy"
}, },
{ {
"label": "Paste",
"role": "paste" "role": "paste"
}, },
{ {
"label": "Paste and Match Style",
"role": "pasteandmatchstyle" "role": "pasteandmatchstyle"
}, },
{ {
"label": "Delete",
"role": "delete" "role": "delete"
}, },
{ {
"label": "Select All",
"role": "selectall" "role": "selectall"
}, },
{ {
@ -70,9 +82,11 @@
"label": "Speech", "label": "Speech",
"submenu": [ "submenu": [
{ {
"label": "Start speaking",
"role": "startspeaking" "role": "startspeaking"
}, },
{ {
"label": "Stop speaking",
"role": "stopspeaking" "role": "stopspeaking"
} }
] ]
@ -83,18 +97,22 @@
"label": "&View", "label": "&View",
"submenu": [ "submenu": [
{ {
"label": "Actual Size",
"role": "resetzoom" "role": "resetzoom"
}, },
{ {
"label": "Zoom In",
"role": "zoomin" "role": "zoomin"
}, },
{ {
"label": "Zoom Out",
"role": "zoomout" "role": "zoomout"
}, },
{ {
"type": "separator" "type": "separator"
}, },
{ {
"label": "Toggle Full Screen",
"role": "togglefullscreen" "role": "togglefullscreen"
}, },
{ {
@ -108,6 +126,7 @@
"type": "separator" "type": "separator"
}, },
{ {
"label": "Toggle Developer Tools",
"role": "toggledevtools" "role": "toggledevtools"
} }
] ]
@ -117,14 +136,17 @@
"role": "window", "role": "window",
"submenu": [ "submenu": [
{ {
"label": "Close Window",
"accelerator": "CmdOrCtrl+W", "accelerator": "CmdOrCtrl+W",
"role": "close" "role": "close"
}, },
{ {
"label": "Minimize",
"accelerator": "CmdOrCtrl+M", "accelerator": "CmdOrCtrl+M",
"role": "minimize" "role": "minimize"
}, },
{ {
"label": "Zoom",
"role": "zoom" "role": "zoom"
}, },
{ {
@ -135,6 +157,7 @@
"type": "separator" "type": "separator"
}, },
{ {
"label": "Bring All to Front",
"role": "front" "role": "front"
} }
] ]

@ -21,6 +21,7 @@
"type": "separator" "type": "separator"
}, },
{ {
"label": "Quit Signal",
"role": "quit" "role": "quit"
} }
] ]
@ -29,30 +30,38 @@
"label": "&Edit", "label": "&Edit",
"submenu": [ "submenu": [
{ {
"label": "Undo",
"role": "undo" "role": "undo"
}, },
{ {
"label": "Redo",
"role": "redo" "role": "redo"
}, },
{ {
"type": "separator" "type": "separator"
}, },
{ {
"label": "Cut",
"role": "cut" "role": "cut"
}, },
{ {
"label": "Copy",
"role": "copy" "role": "copy"
}, },
{ {
"label": "Paste",
"role": "paste" "role": "paste"
}, },
{ {
"label": "Paste and Match Style",
"role": "pasteandmatchstyle" "role": "pasteandmatchstyle"
}, },
{ {
"label": "Delete",
"role": "delete" "role": "delete"
}, },
{ {
"label": "Select All",
"role": "selectall" "role": "selectall"
} }
] ]
@ -61,18 +70,22 @@
"label": "&View", "label": "&View",
"submenu": [ "submenu": [
{ {
"label": "Actual Size",
"role": "resetzoom" "role": "resetzoom"
}, },
{ {
"label": "Zoom In",
"role": "zoomin" "role": "zoomin"
}, },
{ {
"label": "Zoom Out",
"role": "zoomout" "role": "zoomout"
}, },
{ {
"type": "separator" "type": "separator"
}, },
{ {
"label": "Toggle Full Screen",
"role": "togglefullscreen" "role": "togglefullscreen"
}, },
{ {
@ -86,6 +99,7 @@
"type": "separator" "type": "separator"
}, },
{ {
"label": "Toggle Developer Tools",
"role": "toggledevtools" "role": "toggledevtools"
} }
] ]
@ -95,6 +109,7 @@
"role": "window", "role": "window",
"submenu": [ "submenu": [
{ {
"label": "Minimize",
"role": "minimize" "role": "minimize"
} }
] ]

@ -10,6 +10,7 @@
"type": "separator" "type": "separator"
}, },
{ {
"label": "Quit Signal",
"role": "quit" "role": "quit"
} }
] ]
@ -18,30 +19,38 @@
"label": "&Edit", "label": "&Edit",
"submenu": [ "submenu": [
{ {
"label": "Undo",
"role": "undo" "role": "undo"
}, },
{ {
"label": "Redo",
"role": "redo" "role": "redo"
}, },
{ {
"type": "separator" "type": "separator"
}, },
{ {
"label": "Cut",
"role": "cut" "role": "cut"
}, },
{ {
"label": "Copy",
"role": "copy" "role": "copy"
}, },
{ {
"label": "Paste",
"role": "paste" "role": "paste"
}, },
{ {
"label": "Paste and Match Style",
"role": "pasteandmatchstyle" "role": "pasteandmatchstyle"
}, },
{ {
"label": "Delete",
"role": "delete" "role": "delete"
}, },
{ {
"label": "Select All",
"role": "selectall" "role": "selectall"
} }
] ]
@ -50,18 +59,22 @@
"label": "&View", "label": "&View",
"submenu": [ "submenu": [
{ {
"label": "Actual Size",
"role": "resetzoom" "role": "resetzoom"
}, },
{ {
"label": "Zoom In",
"role": "zoomin" "role": "zoomin"
}, },
{ {
"label": "Zoom Out",
"role": "zoomout" "role": "zoomout"
}, },
{ {
"type": "separator" "type": "separator"
}, },
{ {
"label": "Toggle Full Screen",
"role": "togglefullscreen" "role": "togglefullscreen"
}, },
{ {
@ -75,6 +88,7 @@
"type": "separator" "type": "separator"
}, },
{ {
"label": "Toggle Developer Tools",
"role": "toggledevtools" "role": "toggledevtools"
} }
] ]
@ -84,6 +98,7 @@
"role": "window", "role": "window",
"submenu": [ "submenu": [
{ {
"label": "Minimize",
"role": "minimize" "role": "minimize"
} }
] ]

Loading…
Cancel
Save