mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-22 01:57:16 +00:00
MACOSX: Fix application menu i18n compilation for Mac OSX 10.4+
This commit is contained in:
parent
b00586df82
commit
5a42f2901f
@ -22,11 +22,21 @@
|
||||
|
||||
#if defined(MACOSX)
|
||||
|
||||
// Disable symbol overrides so that we can use system headers.
|
||||
#define FORBIDDEN_SYMBOL_ALLOW_ALL
|
||||
|
||||
#include "backends/platform/sdl/macosx/appMenu_osx.h"
|
||||
#include "common/translation.h"
|
||||
|
||||
#include <Cocoa/Cocoa.h>
|
||||
|
||||
// Apple removed setAppleMenu from the header files in 10.4,
|
||||
// but as the method still exists we declare it ourselves here.
|
||||
// Yes, this works :)
|
||||
@interface NSApplication(MissingFunction)
|
||||
- (void)setAppleMenu:(NSMenu *)menu;
|
||||
@end
|
||||
|
||||
void replaceApplicationMenuItems() {
|
||||
|
||||
// Code mainly copied and adapted from SDLmain.m
|
||||
@ -43,7 +53,7 @@ void replaceApplicationMenuItems() {
|
||||
appleMenu = [[NSMenu alloc] initWithTitle:@""];
|
||||
|
||||
// Get current encoding
|
||||
NSStringEncoding *stringEncoding = CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding((CFStringRef)[NSString stringWithCString:(TransMan.getCurrentCharset()).c_str() encoding:NSASCIIStringEncoding]));
|
||||
NSStringEncoding stringEncoding = CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding((CFStringRef)[NSString stringWithCString:(TransMan.getCurrentCharset()).c_str() encoding:NSASCIIStringEncoding]));
|
||||
|
||||
// Add "About ScummVM" menu item
|
||||
[appleMenu addItemWithTitle:[NSString stringWithCString:_("About ScummVM") encoding:stringEncoding] action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
|
||||
|
Loading…
x
Reference in New Issue
Block a user