/*
 * Sample test program for gnumeric --help localize problem
 *                                    by Yukihiro Nakai <ynakai@redhat.com>
 *    http://bugzilla.gnome.org/show_bug.cgi?id=120219
 *
 *  Build option:
 *  gcc -o main main.c `pkg-config libgnome-2.0 libgnomeui-2.0 --cflags --libs`
 *
 */


#include <libgnome/gnome-program.h>
#include <libgnomeui/gnome-ui-init.h>
#include <locale.h>

#define PACKAGE "gnumeric" /* Fake to get strings from gnumeric.mo */
#define VERSION "1.1.20-bonobo" /* Same to the above */

#include <libintl.h>
#include <libgnome/gnome-i18n.h>

gboolean prog_show_version = FALSE;

const struct poptOption
popt_options[] = {
//  { NULL, '\0', POPT_ARG_INTL_DOMAIN, PACKAGE, 0, NULL, NULL},
       { "version", 'v', POPT_ARG_NONE, &prog_show_version, 0,
          N_("Display Gnumeric's version"), NULL  },
//          "\xef\xbc\xa1\xef\xbc\xa1\xef\xbc\xa1", NULL  }, /* Japanese Full-with 'AAA' in UTF-8 */
        { NULL, '\0', 0, NULL, 0 }
};

int main(int argc, char** argv) {

  bindtextdomain(PACKAGE, "/usr/share/locale");
  bind_textdomain_codeset(PACKAGE, "UTF-8");
  textdomain(PACKAGE);

  setlocale(LC_ALL, "");

  GnomeProgram *program = gnome_program_init(PACKAGE, VERSION,
	LIBGNOMEUI_MODULE, argc, argv,
	GNOME_PARAM_APP_PREFIX, "/usr",
	GNOME_PARAM_APP_SYSCONFDIR, "/etc",
	GNOME_PARAM_APP_DATADIR, "/usr/share/",
	GNOME_PARAM_APP_LIBDIR, "/usr/lib/",
	GNOME_PARAM_POPT_TABLE, popt_options,
	NULL);

  return 0;
}
