[gegl] move i18n init early to have help message translated



commit 3a6a65819088f7bb2a17dcabfcb8ccdfa8a01dd8
Author: Michael Murà <batolettre gmail com>
Date:   Wed Jul 18 14:54:02 2012 +0900

    move i18n init early to have help message translated

 bin/gegl.c       |   14 +++++++-------
 gegl/gegl-init.c |   20 ++++++++++----------
 2 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/bin/gegl.c b/bin/gegl.c
index 20f23db..25174ef 100644
--- a/bin/gegl.c
+++ b/bin/gegl.c
@@ -86,13 +86,6 @@ main (gint    argc,
   GError      *err       = NULL;
   gchar       *path_root = NULL;
 
-  o = gegl_options_parse (argc, argv);
-
-  if (o->fatal_warnings)
-    {
-      gegl_enable_fatal_warnings ();
-    }
-
   g_thread_init (NULL);
   gegl_init (&argc, &argv);
 #ifdef HAVE_SPIRO
@@ -100,6 +93,13 @@ main (gint    argc,
 #endif
   gegl_path_smooth_init ();
 
+  o = gegl_options_parse (argc, argv);
+
+  if (o->fatal_warnings)
+    {
+      gegl_enable_fatal_warnings ();
+    }
+
   if (o->xml)
     {
       path_root = g_get_current_dir ();
diff --git a/gegl/gegl-init.c b/gegl/gegl-init.c
index a2aada7..f2fe078 100644
--- a/gegl/gegl-init.c
+++ b/gegl/gegl-init.c
@@ -154,6 +154,14 @@ static glong         global_time = 0;
 
 static const gchar *makefile (void);
 
+static void
+gegl_init_i18n (void)
+{
+  setlocale (LC_ALL, "");
+  bindtextdomain (GETTEXT_PACKAGE, GEGL_LOCALEDIR);
+  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+}
+
 void
 gegl_init (gint    *argc,
            gchar ***argv)
@@ -163,6 +171,8 @@ gegl_init (gint    *argc,
   if (config)
     return;
 
+  gegl_init_i18n ();
+
   /*  If any command-line actions are ever added to GEGL, then the commented
    *  out code below should be used.  Until then, we simply call the parse hook
    *  directly.
@@ -412,14 +422,6 @@ gegl_exit (void)
 
 static void swap_clean (void);
 
-static void
-gegl_init_i18n (void)
-{
-  setlocale (LC_ALL, "");
-  bindtextdomain (GETTEXT_PACKAGE, GEGL_LOCALEDIR);
-  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-}
-
 void
 gegl_get_version (int *major,
                   int *minor,
@@ -496,8 +498,6 @@ gegl_post_parse_hook (GOptionContext *context,
 
   gegl_instrument ("gegl_init", "babl_init", gegl_ticks () - time);
 
-  gegl_init_i18n ();
-
   time = gegl_ticks ();
   if (!module_db)
     {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]