Add TRANS to Mac Main Menu Items?


#1

Hi juce team,

In the file “juce_mac_MainMenu.mm”, could you add TRANS on the “Hide”, “Hide Others”, “Show All” and “Quit”?

Thanks.

static void createStandardAppMenu (NSMenu* menu, const String& appName, const PopupMenu* extraItems)
{
    if (extraItems != nullptr && JuceMainMenuHandler::instance != nullptr && extraItems->getNumItems() > 0)
    {
        for (PopupMenu::MenuItemIterator iter (*extraItems); iter.next();)
            JuceMainMenuHandler::instance->addMenuItem (iter, menu, 0, -1);

        [menu addItem: [NSMenuItem separatorItem]];
    }

    // Services...
    NSMenuItem* services = [[[NSMenuItem alloc] initWithTitle: translateMenuName ("Services")
                                                       action: nil  keyEquivalent: nsEmptyString()] autorelease];
    [menu addItem: services];

    NSMenu* servicesMenu = [[[NSMenu alloc] initWithTitle: translateMenuName ("Services")] autorelease];
    [menu setSubmenu: servicesMenu forItem: services];
    [NSApp setServicesMenu: servicesMenu];
    [menu addItem: [NSMenuItem separatorItem]];

    createMenuItem (menu, "Hide " + appName, @selector (hide:), nsStringLiteral ("h"));

    [createMenuItem (menu, "Hide Others", @selector (hideOtherApplications:), nsStringLiteral ("h"))
        setKeyEquivalentModifierMask: NSCommandKeyMask | NSAlternateKeyMask];

    createMenuItem (menu, "Show All", @selector (unhideAllApplications:), nsEmptyString());

    [menu addItem: [NSMenuItem separatorItem]];

    createMenuItem (menu, "Quit " + appName, @selector (terminate:), nsStringLiteral ("q"));
}

#2

Sure, will add that…