aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTeddy Wing2023-08-23 01:01:24 +0200
committerTeddy Wing2023-08-23 01:01:24 +0200
commite29b5f548269d8956d7b664ae32edc6d8a104b2c (patch)
tree5a16c34d407ed20ca64547b7b2908089689d1993 /src
parent10ba80e2d2c39d90411484b823255afa44c94583 (diff)
downloadBase-Windowed-Application-e29b5f548269d8956d7b664ae32edc6d8a104b2c.tar.bz2
MainMenu: Use stringWithFormat for titles containing application name
I get the sense that the word order, particularly for the "Help" menu item, may be different in other languages. Rather than force a certain word order by concatenating strings, include the application name in the localisation by making it a format string with an argument.
Diffstat (limited to 'src')
-rw-r--r--src/MainMenu.m24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/MainMenu.m b/src/MainMenu.m
index e7f3f05..e5f46f5 100644
--- a/src/MainMenu.m
+++ b/src/MainMenu.m
@@ -69,9 +69,9 @@ NSMenuItem *MainMenuCreateApplicationMenuItem()
@"Application menu title."
)];
- NSString *about_title = [[NSLocalizedString(@"About", @"About menu item.")
- stringByAppendingString:@" "]
- stringByAppendingString:MainMenuGetApplicationName()];
+ NSString *about_title = [NSString
+ stringWithFormat:NSLocalizedString(@"About %@", @"About menu item."),
+ MainMenuGetApplicationName()];
NSMenuItem *about_menu_item = [application_menu
addItemWithTitle:about_title
action:@selector(orderFrontStandardAboutPanel:)
@@ -106,9 +106,9 @@ NSMenuItem *MainMenuCreateApplicationMenuItem()
[application_menu addItem:[NSMenuItem separatorItem]];
- NSString *hide_title = [[NSLocalizedString(@"Hide", @"Hide menu item.")
- stringByAppendingString:@" "]
- stringByAppendingString:MainMenuGetApplicationName()];
+ NSString *hide_title = [NSString
+ stringWithFormat:NSLocalizedString(@"Hide %@", @"Hide menu item."),
+ MainMenuGetApplicationName()];
NSMenuItem *hide_menu_item = [application_menu
addItemWithTitle:hide_title
action:@selector(hide:)
@@ -137,9 +137,9 @@ NSMenuItem *MainMenuCreateApplicationMenuItem()
[application_menu addItem:[NSMenuItem separatorItem]];
- NSString *quit_title = [[NSLocalizedString(@"Quit", @"Quit menu item.")
- stringByAppendingString:@" "]
- stringByAppendingString:MainMenuGetApplicationName()];
+ NSString *quit_title = [NSString
+ stringWithFormat:NSLocalizedString(@"Quit %@", @"Quit menu item."),
+ MainMenuGetApplicationName()];
NSMenuItem *quit_menu_item = [application_menu
addItemWithTitle:quit_title
action:@selector(terminate:)
@@ -973,9 +973,9 @@ NSMenuItem *MainMenuCreateHelpMenuItem()
@"Help menu title."
)];
- NSString *help_title = [[MainMenuGetApplicationName()
- stringByAppendingString:@" "]
- stringByAppendingString:NSLocalizedString(@"Help", @"Help menu item.")];
+ NSString *help_title = [NSString
+ stringWithFormat:NSLocalizedString(@"%@ Help", @"Help menu item."),
+ MainMenuGetApplicationName()];
[help_menu
addItemWithTitle:help_title
action:@selector(showHelp:)