From 04c5e65b8cd52bf10d49375d22ba0908efbaa985 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 16 Oct 2012 21:24:02 -0700 Subject: Redoing the Mac bundling With the right tools in place you can now create a bundle from the Makefile by calling "make create-macos-bundle" In the process of this I also moved the locale directory where we stage our .mo files to share/locale (which is much more logical). Signed-off-by: Dirk Hohndel --- macos.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'macos.c') diff --git a/macos.c b/macos.c index bb10baa3c..585e879b0 100644 --- a/macos.c +++ b/macos.c @@ -106,15 +106,13 @@ const char *subsurface_default_filename() const char *subsurface_gettext_domainpath() { - CFBundleRef mainBundle = CFBundleGetMainBundle(); - CFURLRef localeURL = CFBundleCopyResourceURL(mainBundle, CFSTR("share/locale"), CFSTR(""), NULL); - if (localeURL) { - CFStringRef localePath = CFURLCopyFileSystemPath(localeURL, kCFURLPOSIXPathStyle); - CFStringEncoding encodingMethod = CFStringGetSystemEncoding(); - const char *path = CFStringGetCStringPtr(localePath, encodingMethod); - return path; + static char buffer[256]; + const char *resource_path = quartz_application_get_resource_path(); + if (resource_path) { + snprintf(buffer, sizeof(buffer), "%s/share/locale", resource_path); + return buffer; } - return "./locale"; + return "./share/locale"; } static void show_main_window(GtkWidget *w, gpointer data) -- cgit v1.2.3-70-g09d2