|
From: | Joshua Pettus |
Subject: | Re: [XBoard-devel] Gettext localization will work with the osx app! |
Date: | Sun, 5 Oct 2014 01:55:31 -0400 |
Hmm, Well I clearly don’t have a clue as to what I’m doing I added these lines to xboard.c main() (mimicking what HGM did for SVGDIR) I know they would have to be put in ifdef ENABLE_NLS but I just want it working. #ifdef __APPLE__ { // prepare to catch OX OpenFile signal, which will tell us the clicked file char *path = gtkosx_application_get_bundle_path(); theApp = g_object_new(GTKOSX_TYPE_APPLICATION, NULL); strncpy(dataDir, path, MSG_SIZ); snprintf(masterSettings, MSG_SIZ, "%s/Contents/Resources/etc/xboard.conf", path); snprintf(svgDir, MSG_SIZ, "%s/Contents/Resources/share/xboard/themes/default", path); + char localeDir[MSG_SIZ] = LOCALEDIR; + snprintf(localeDir, MSG_SIZ, "%s/Contents/Resources/share/locale", path); suppress = (argc == 1 || argc > 1 && argv[1][00] != '-'); // OSX sends signal even if name was already argv[1]! g_signal_connect(theApp, "NSApplicationOpenFile", G_CALLBACK(StartNewXBoard), NULL); // we must call application ready before we can get the signal, // and supply a (dummy) menu bar before that, to avoid problems with dual apples in it gtkosx_application_set_menu_bar(theApp, GTK_MENU_SHELL(gtk_menu_bar_new())); gtkosx_application_ready(theApp); if(argc == 1) { // called without args: OSX open-file signal might follow static char *fakeArgv[3] = {NULL, clickedFile, NULL}; usleep(10000); // wait 10 msec (and hope this is long enough). while(gtk_events_pending()) gtk_main_iteration(); // process all events that came in upto now suppress = 0; // future open-file signals should start new instance if(clickedFile[0]) { // we were sent an open-file signal with filename! fakeArgv[0] = argv[0]; argc = 2; argv = fakeArgv; // fake that we were called as "xboard filename" } } } #endif knowing that below there is bindtextdomain(PACKAGE, LOCALEDIR); and to xboard.h + extern char localeDir[]; It compiles but it doesn’t find the locale folder like I hoped… Any ideas, or is what I’m doing complete gibberish? -Josh On 04.10.2014, at 11:14 nachm., Joshua Pettus <address@hidden> wrote: I see, it’s a form of Cantonese. I could attempt to make a folder for that. Can’t tell you how useable that would be. :) |
[Prev in Thread] | Current Thread | [Next in Thread] |