7070#import " TDCServerChangeNicknameSheetPrivate.h"
7171#import " TDCServerPropertiesSheetPrivate.h"
7272#import " TDCWelcomeSheetPrivate.h"
73+ #import " TPCApplicationInfo.h"
7374#import " TPCPathInfoPrivate.h"
7475#import " TPCPreferencesImportExport.h"
7576#import " TPCPreferencesLocalPrivate.h"
@@ -96,6 +97,8 @@ - (void)prepareInitialState
9697
9798 [self .channelViewGeneralMenu itemWithTag: MTWKGeneralChannelMenu].submenu = [self .mainMenuChannelMenu copy ];
9899
100+ [self nameMenuItemsAfterApplication ];
101+
99102 [self setupOtherServices ];
100103
101104 [RZNotificationCenter () addObserver: self selector: @selector (menuItemWillPerformedAction: ) name: NSMenuWillSendActionNotification object: nil ];
@@ -104,6 +107,34 @@ - (void)prepareInitialState
104107 [RZNotificationCenter () addObserver: self selector: @selector (mainWindowSelectionChanged: ) name: TVCMainWindowSelectionChangedNotification object: nil ];
105108}
106109
110+ /* The interface file says "Textual": Textual Dev says its own name (the
111+ bundle's; the product name is "Textual" in both) */
112+ - (void )nameMenuItemsAfterApplication
113+ {
114+ NSString *applicationName = [RZMainBundle () objectForInfoDictionaryKey: @" CFBundleName" ];
115+
116+ if (applicationName.length == 0 ) {
117+ applicationName = [TPCApplicationInfo applicationName ];
118+ }
119+
120+ NSDictionary <NSNumber *, NSString *> *titles = @{
121+ @(MTMMAppAboutApp) : TXTLS (@" BasicLanguage[app-n1]" , applicationName),
122+ @(MTMMAppHideApp) : TXTLS (@" BasicLanguage[app-n2]" , applicationName),
123+ @(MTMMAppQuitApp) : TXTLS (@" BasicLanguage[app-n3]" , applicationName),
124+ @(MTMMHelpTextualHelp) : TXTLS (@" BasicLanguage[app-n4]" , applicationName)
125+ };
126+
127+ for (NSMenuItem *menuItem in NSApp .mainMenu .itemArray ) {
128+ for (NSMenuItem *submenuItem in menuItem.submenu .itemArray ) {
129+ NSString *title = titles[@(submenuItem.tag)];
130+
131+ if (title) {
132+ submenuItem.title = title;
133+ }
134+ }
135+ }
136+ }
137+
107138- (void )setupOtherServices
108139{
109140 [self .fileTransferController startUsingDownloadDestinationURL ];
0 commit comments