[mutter] Don't call textdomain()



commit d9007a08c964c51968bd07883083f0f04c2e3ed0
Author: Dan Winship <danw gnome org>
Date:   Mon May 2 11:55:14 2011 -0400

    Don't call textdomain()
    
    As a library, libmutter should not be setting the default translation
    domain to point to itself.
    
    Also, move the bindtextdomain() call earlier
    (meta_get_option_context), so that translations of command-line
    options will be available.
    
    We could call textdomain() in mutter.c, but there's no need to, since
    mutter uses dgettext() everywhere anyway.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=649202

 src/core/main.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/src/core/main.c b/src/core/main.c
index 06658eb..c7fe290 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -251,6 +251,11 @@ meta_get_option_context (void)
 {
   GOptionContext *ctx;
 
+  if (setlocale (LC_ALL, "") == NULL)
+    meta_warning ("Locale not understood by C library, internationalization will not work\n");
+  bindtextdomain (GETTEXT_PACKAGE, MUTTER_LOCALEDIR);
+  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+
   ctx = g_option_context_new (NULL);
   g_option_context_add_main_entries (ctx, meta_options, GETTEXT_PACKAGE);
   g_option_context_add_group (ctx, clutter_get_option_group_without_init ());
@@ -385,9 +390,6 @@ meta_init (void)
   sigset_t empty_mask;
   GIOChannel *channel;
 
-  if (setlocale (LC_ALL, "") == NULL)
-    meta_warning ("Locale not understood by C library, internationalization will not work\n");
-
   g_type_init ();
   
   sigemptyset (&empty_mask);
@@ -430,10 +432,6 @@ meta_init (void)
 
   meta_print_self_identity ();
   
-  bindtextdomain (GETTEXT_PACKAGE, MUTTER_LOCALEDIR);
-  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-  textdomain (GETTEXT_PACKAGE);
-
 #ifdef HAVE_INTROSPECTION
   g_irepository_prepend_search_path (MUTTER_PKGLIBDIR);
 #endif



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