<commit_before>import App from 'app';

/**
 * Main menu.
 */
export default class MainMenu {
  /**
   * Create menu.
   *
   * @param {Main} context Application instance.
   *
   * @return {Array.<Object>} Menu.
   */
  static menu( context ) {
    const templates = [
      { label: 'App', submenu: [
        { label: 'About Electron Audio Player', command: 'application:about' },
        { label: 'Quit', command: 'application:quit' }
      ] }
    ];

    if( DEBUG ) {
      templates.push( {
        label: 'Debug', submenu: [
          { label: 'Reload', command: 'debug:reload' },
          { label: 'Developer Tools', command: 'debug:dev-tools' }
        ]
      } );
    }

    const keymaps  = MainMenu._keymaps();
    const handlers = MainMenu._handlers( context );

    return templates.map( ( template ) => {
      return {
        label:   template.label,
        submenu: template.submenu.map( ( item ) => {
          return {
            label: item.label,
            accelerator: keymaps[ item.command ],
            click: handlers[ item.command ]
          }
        } )
      }
    } );
  }

  /**
   * Get the keyboard shortcuts maps for OS X.
   *
   * @return {Object} Success is key maps ( Key/Value pare ).
   */
  static _keymaps() {
    switch( process.platform ) {
      case 'darwin':
        return {
          'application:quit': 'command+q',

          'debug:reload':    'command+r',
          'debug:dev-tools': 'command+alt+i'
        };

      case 'win32':
        return {
          'application:quit': 'alt+f4',

          'debug:reload':    'ctrl+r',
          'debug:dev-tools': 'ctrl+alt+i'
        };

      // Otherwise Linux
      default:
        return {
          'application:quit': 'ctrl+q',

          'debug:reload':    'ctrl+r',
          'debug:dev-tools': 'ctrl+alt+i'
        };
    }
  }

  /**
   * Get the handler functions when the menu item is clicked.
   *
   * @param {Main} context Application instance.
   *
   * @return {Object} Menu handler functions ( Key/Value pare ).
   */
  static _handlers( context ) {
    return {
      'application:about': () => { context.windowManager.createAboutWindow(); },
      'application:quit': () => { App.quit(); },

      'debug:reload':    () => { context.windowManager.reload(); },
      'debug:dev-tools': () => { context.windowManager.toggleDevTools(); }
    }
  }
}
<commit_msg>#61 Fix a menu text<commit_after>import App from 'app';

/**
 * Main menu.
 */
export default class MainMenu {
  /**
   * Create menu.
   *
   * @param {Main} context Application instance.
   *
   * @return {Array.<Object>} Menu.
   */
  static menu( context ) {
    const templates = [
      { label: 'App', submenu: [
        { label: 'About Multiple Windows', command: 'application:about' },
        { label: 'Quit', command: 'application:quit' }
      ] }
    ];

    if( DEBUG ) {
      templates.push( {
        label: 'Debug', submenu: [
          { label: 'Reload', command: 'debug:reload' },
          { label: 'Developer Tools', command: 'debug:dev-tools' }
        ]
      } );
    }

    const keymaps  = MainMenu._keymaps();
    const handlers = MainMenu._handlers( context );

    return templates.map( ( template ) => {
      return {
        label:   template.label,
        submenu: template.submenu.map( ( item ) => {
          return {
            label: item.label,
            accelerator: keymaps[ item.command ],
            click: handlers[ item.command ]
          }
        } )
      }
    } );
  }

  /**
   * Get the keyboard shortcuts maps for OS X.
   *
   * @return {Object} Success is key maps ( Key/Value pare ).
   */
  static _keymaps() {
    switch( process.platform ) {
      case 'darwin':
        return {
          'application:quit': 'command+q',

          'debug:reload':    'command+r',
          'debug:dev-tools': 'command+alt+i'
        };

      case 'win32':
        return {
          'application:quit': 'alt+f4',

          'debug:reload':    'ctrl+r',
          'debug:dev-tools': 'ctrl+alt+i'
        };

      // Otherwise Linux
      default:
        return {
          'application:quit': 'ctrl+q',

          'debug:reload':    'ctrl+r',
          'debug:dev-tools': 'ctrl+alt+i'
        };
    }
  }

  /**
   * Get the handler functions when the menu item is clicked.
   *
   * @param {Main} context Application instance.
   *
   * @return {Object} Menu handler functions ( Key/Value pare ).
   */
  static _handlers( context ) {
    return {
      'application:about': () => { context.windowManager.createAboutWindow(); },
      'application:quit': () => { App.quit(); },

      'debug:reload':    () => { context.windowManager.reload(); },
      'debug:dev-tools': () => { context.windowManager.toggleDevTools(); }
    }
  }
}

{'fraction_non_alphanumeric': 0.15637429348963786, 'fraction_numerical': 0.0016746912288046892, 'mean_word_length': 1.9384993849938499, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '512131', 'n_tokens_mistral': 1498, 'n_tokens_neox': 1466, 'n_words': 325}