Added top level menu shortcuts, pull labels from messages.json (#1702)

* Added top level menu shortcuts (Fixes #1688 and #1695).

The ampersand (&) character in front of a letter in a menu label
indicates that the letter that follows '&' will be used as a keyboard
shortcut letter to access this menu. In Windows/Linux, the default
shortcut combination is Alt+<letter>.

* Use non-hardcoded menu labels.

The menu labels were hardcoded in English.
We should not be using plain strings right in the source code, but
pulling them from the `messages.json` files instead.
pull/749/head
Vangelis 8 years ago committed by Scott Nonnenberg
parent 7d53e69958
commit c0c4730bad

@ -1,4 +1,24 @@
{
"mainMenuFile": {
"message": "&File",
"description": "The label that is used for the File menu in the program main menu. The '&' indicates that the following letter will be used as the keyboard 'shortcut letter' for accessing the menu with the Alt-<letter> combination."
},
"mainMenuEdit": {
"message": "&Edit",
"description": "The label that is used for the Edit menu in the program main menu. The '&' indicates that the following letter will be used as the keyboard 'shortcut letter' for accessing the menu with the Alt-<letter> combination."
},
"mainMenuView": {
"message": "&View",
"description": "The label that is used for the View menu in the program main menu. The '&' indicates that the following letter will be used as the keyboard 'shortcut letter' for accessing the menu with the Alt-<letter> combination."
},
"mainMenuWindow": {
"message": "&Window",
"description": "The label that is used for the Window menu in the program main menu. The '&' indicates that the following letter will be used as the keyboard 'shortcut letter' for accessing the menu with the Alt-<letter> combination."
},
"mainMenuHelp": {
"message": "&Help",
"description": "The label that is used for the Help menu in the program main menu. The '&' indicates that the following letter will be used as the keyboard 'shortcut letter' for accessing the menu with the Alt-<letter> combination."
},
"loading": {
"message": "Loading...",
"description": "Message shown on the loading screen before we've loaded any messages"

@ -7,7 +7,7 @@ function createTemplate(options, messages) {
const openForums = options.openForums;
let template = [{
label: 'File',
label: messages.mainMenuFile.message,
submenu: [
{
role: 'quit',
@ -15,7 +15,7 @@ function createTemplate(options, messages) {
]
},
{
label: 'Edit',
label: messages.mainMenuEdit.message,
submenu: [
{
role: 'undo',
@ -47,7 +47,7 @@ function createTemplate(options, messages) {
]
},
{
label: 'View',
label: messages.mainMenuView.message,
submenu: [
{
role: 'resetzoom',
@ -80,6 +80,7 @@ function createTemplate(options, messages) {
]
},
{
label: messages.mainMenuWindow.message,
role: 'window',
submenu: [
{
@ -88,6 +89,7 @@ function createTemplate(options, messages) {
]
},
{
label: messages.mainMenuHelp.message,
role: 'help',
submenu: [
{

Loading…
Cancel
Save