mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Support for gettext in MacOSX application bundle
The MacOSX applications bundle needs to be told where to bind the text domain from. Also copy the gettext .mo files in the install-macosx target. [Dirk Hohndel: minor change in main(): move the path declaration to the beginning of the function] Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5c432d3c8a
commit
ef039c9d32
6 changed files with 31 additions and 1 deletions
13
macos.c
13
macos.c
|
@ -104,6 +104,19 @@ const char *subsurface_default_filename()
|
|||
}
|
||||
}
|
||||
|
||||
const char *subsurface_gettext_domainpath()
|
||||
{
|
||||
CFBundleRef mainBundle = CFBundleGetMainBundle();
|
||||
CFURLRef localeURL = CFBundleCopyResourceURL(mainBundle, CFSTR("locale"), CFSTR(""), NULL);
|
||||
if (localeURL) {
|
||||
CFStringRef localePath = CFURLCopyFileSystemPath(localeURL, kCFURLPOSIXPathStyle);
|
||||
CFStringEncoding encodingMethod = CFStringGetSystemEncoding();
|
||||
const char *path = CFStringGetCStringPtr(localePath, encodingMethod);
|
||||
return path;
|
||||
}
|
||||
return "./locale";
|
||||
}
|
||||
|
||||
static void show_main_window(GtkWidget *w, gpointer data)
|
||||
{
|
||||
gtk_widget_show(main_window);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue