MACOSX: Add i18n support for Mac OSX application menu

This commit is contained in:
CeRiAl 2011-07-03 22:34:20 +02:00
parent c4b2800145
commit b00586df82
5 changed files with 147 additions and 1 deletions

View file

@ -29,9 +29,12 @@
#include "backends/platform/sdl/macosx/macosx.h"
#include "backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h"
#include "backends/platform/sdl/macosx/appMenu_osx.h"
#include "common/archive.h"
#include "common/config-manager.h"
#include "common/fs.h"
#include "common/translation.h"
#include "ApplicationServices/ApplicationServices.h" // for LSOpenFSRef
#include "CoreFoundation/CoreFoundation.h" // for CF* stuff
@ -51,6 +54,15 @@ void OSystem_MacOSX::initBackend() {
_mixerManager->init();
}
#ifdef USE_TRANSLATION
// We need to initialize the translataion manager here for the following
// call to replaceApplicationMenuItems() work correctly
TransMan.setLanguage(ConfMan.get("gui_language").c_str());
#endif // USE_TRANSLATION
// Replace the SDL generated menu items with our own translated ones on Mac-OSX
replaceApplicationMenuItems();
// Invoke parent implementation of this method
OSystem_POSIX::initBackend();
}