public static void renameAppMenuItems() {
    // NOTE: Application menu (i.e. first menu item with text = app name) for java application is loaded from
    // system framework 'JavaVM' (see NSApplicationAWT::finishLaunching). After execution of [NSBundle loadNibFile...]
    // we will have loaded app menu with hardcoded english (not internationalized) strings:
    // About %@
    // Preferences...
    // Services
    // Hide %@
    // Hide Others
    // Show All
    // Quit %@
    // And then %@ is replaced with $CFBundleName. Since strings are constant we will find menu item just by it's title.

    List<String> replace = new ArrayList<>(7);
    String bundleName = getBundleName();
    if (bundleName == null || bundleName.isEmpty()) {
      ApplicationNamesInfo names = ApplicationNamesInfo.getInstance();
      bundleName = names.getProductName();
    }

    replace.add("About.*");
    replace.add(removeMnemonic(ActionsBundle.message("action.About.text")) + " " + bundleName);

    // NOTE: Check For Updates is installed via Foundation from MacAppProvider
    replace.add("Check for Updates...");
    replace.add(removeMnemonic(ActionsBundle.message("action.CheckForUpdate.text")));

    //macOS 13.0 Ventura uses Settings instead of Preferences. See IDEA-300314
    String replacement = SystemInfo.isMacOSVentura ?
      removeMnemonic(CommonBundle.message("action.settings.macOS.ventura")):
      removeMnemonic(CommonBundle.message("action.settings.mac"));
    replace.add("Preferences.*"); // this replacement will be applied only on old OSX systems
    replace.add(replacement);
    replace.add("Settings.*");  // this replacement will be applied only on last OSX systems
    replace.add(replacement);

    replace.add("Services");
    replace.add(removeMnemonic(CommonBundle.message("action.appmenu.services")));

    replace.add("Hide " + bundleName);
    replace.add(removeMnemonic(CommonBundle.message("action.appmenu.hide_ide") + " " + bundleName));

    replace.add("Hide Others");
    replace.add(removeMnemonic(CommonBundle.message("action.appmenu.hide_others")));

    replace.add("Show All");
    replace.add(removeMnemonic(CommonBundle.message("action.appmenu.show_all")));

    replace.add("Quit.*");
    replace.add(removeMnemonic(CommonBundle.message("action.appmenu.quit") + " " + bundleName));

    nativeRenameAppMenuItems(ArrayUtilRt.toStringArray(replace));
  }
public static void renameAppMenuItems()