gvfs r1186 - in trunk: . daemon



Author: alexl
Date: Mon Jan 28 10:54:14 2008
New Revision: 1186
URL: http://svn.gnome.org/viewvc/gvfs?rev=1186&view=rev

Log:
2008-01-28  Alexander Larsson  <alexl redhat com>

        * daemon/Makefile.am:
        * daemon/daemon-main.c:
        * daemon/main.c:
	Enable translations for daemons and some l10n
	fixes. Patch from Luca Ferretti.



Modified:
   trunk/ChangeLog
   trunk/daemon/Makefile.am
   trunk/daemon/daemon-main.c
   trunk/daemon/main.c

Modified: trunk/daemon/Makefile.am
==============================================================================
--- trunk/daemon/Makefile.am	(original)
+++ trunk/daemon/Makefile.am	Mon Jan 28 10:54:14 2008
@@ -11,6 +11,7 @@
 	-DDBUS_API_SUBJECT_TO_CHANGE		\
 	-DLIBEXEC_DIR=\"$(libexecdir)/\" 	\
 	-DMOUNTABLE_DIR=\"$(mountdir)/\" 	\
+	-DGVFS_LOCALEDIR=\""$(localedir)"\"     \
 	-DG_DISABLE_DEPRECATED
 
 noinst_LTLIBRARIES=libdaemon.la

Modified: trunk/daemon/daemon-main.c
==============================================================================
--- trunk/daemon/daemon-main.c	(original)
+++ trunk/daemon/daemon-main.c	Mon Jan 28 10:54:14 2008
@@ -44,6 +44,12 @@
 {
   DBusConnection *connection;
   DBusError derror;
+
+  setlocale (LC_ALL, "");
+
+  bindtextdomain (GETTEXT_PACKAGE, GVFS_LOCALEDIR);
+  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+  textdomain (GETTEXT_PACKAGE);
   
   dbus_threads_init_default ();
   g_thread_init (NULL);
@@ -53,7 +59,8 @@
   connection = dbus_bus_get (DBUS_BUS_SESSION, &derror);
   if (connection == NULL)
     {
-      g_printerr (_("Error connecting to D-Bus: %s\n"), derror.message);
+      g_printerr (_("Error connecting to D-Bus: %s"), derror.message);
+      g_printerr ("\n");
       dbus_error_free (&derror);
       exit (1);
     }
@@ -71,7 +78,8 @@
   if (spawner_id == NULL || spawner_path == NULL)
     {
       if (!succeeded)
-	g_print ("Error: %s\n", error_message);
+      g_printerr (_("Error: %s"), error_message);
+      g_printerr ("_\n");
       return;
     }
   
@@ -103,7 +111,8 @@
     {
       if (argc < 4)
 	{
-	  g_printerr ("Usage: %s --spawner dbus-id object_path\n", argv[0]);
+	  g_printerr (_("Usage: %s --spawner dbus-id object_path"), argv[0]);
+          g_printerr ("\n");
 	  exit (1);
 	}
 
@@ -126,7 +135,8 @@
 	  p = strchr (argv[i], '=');
 	  if (p == NULL || p[1] == 0 || p == argv[i])
 	    {
-	      g_printerr ("Usage: %s key=value key=value ...\n", argv[0]);
+ 	      g_printerr (_("Usage: %s key=value key=value ..."), argv[0]);
+              g_printerr ("\n");
 	      exit (1);
 	    }
 	  
@@ -141,8 +151,10 @@
 
       if (!found_type)
 	{
-	  g_printerr ("No mount type specified\n");
-	  g_printerr ("Usage: %s key=value key=value ...\n", argv[0]);
+	  g_printerr (_("No mount type specified"));
+          g_printerr ("\n");
+	  g_printerr (_("Usage: %s key=value key=value ..."), argv[0]);
+          g_printerr ("\n");
 	  exit (1);
 	}
     }
@@ -174,7 +186,8 @@
   connection = dbus_bus_get (DBUS_BUS_SESSION, &derror);
   if (connection == NULL)
     {
-      g_printerr (_("Error connecting dbus: %s\n"), derror.message);
+      g_printerr (_("Error connecting to D-Bus: %s"), derror.message);
+      g_printerr ("\n");
       dbus_error_free (&derror);
       exit (1);
     }

Modified: trunk/daemon/main.c
==============================================================================
--- trunk/daemon/main.c	(original)
+++ trunk/daemon/main.c	Mon Jan 28 10:54:14 2008
@@ -1,3 +1,5 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+
 /* GIO - GLib Input, Output and Streaming Library
  * 
  * Copyright (C) 2006-2007 Red Hat, Inc.
@@ -46,12 +48,18 @@
     { NULL }
   };
 
+  setlocale (LC_ALL, "");
+
+  bindtextdomain (GETTEXT_PACKAGE, GVFS_LOCALEDIR);
+  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+  textdomain (GETTEXT_PACKAGE);
+  
   g_thread_init (NULL);
   
   g_set_application_name (_("GVFS Daemon"));
   context = g_option_context_new ("");
 
-  g_option_context_set_summary (context, "Main daemon for GVFS");
+  g_option_context_set_summary (context, _("Main daemon for GVFS"));
   
   g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE);
 
@@ -60,7 +68,13 @@
   error = NULL;
   if (!g_option_context_parse (context, &argc, &argv, &error))
     {
-      g_print ("%s, use --help for usage\n", error->message);
+      /* Translators: the first %s is the application name, */
+      /* the second %s is the error message                 */
+      g_printerr (_("%s: %s"), g_get_application_name(), error->message);
+      g_printerr ("\n");
+      g_printerr (_("Try \"%s --help\" for more information."),
+                  g_get_prgname ());
+      g_printerr ("\n");
       g_error_free (error);
       return 1;
     }



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