[grilo] i18n: Add support for internationalization



commit e1959c237fcf75721267b6be13118fd7558c9c87
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Mon Mar 18 19:20:56 2013 +0100

    i18n: Add support for internationalization

 Makefile.am                      |    2 +-
 configure.ac                     |   13 ++++++-----
 libs/net/Makefile.am             |    1 +
 libs/net/grl-net-mock.c          |    7 +++--
 libs/net/grl-net-private.c       |   17 ++++++++-------
 libs/net/grl-net-soup-stable.c   |    2 +-
 libs/net/grl-net-soup-unstable.c |    7 +++--
 po/POTFILES.in                   |    8 +++++++
 src/Makefile.am                  |    1 +
 src/grilo.c                      |   16 ++++++++++----
 src/grl-multiple.c               |   15 ++++++++++---
 src/grl-registry.c               |   40 ++++++++++++++++++++-----------------
 src/grl-source.c                 |   21 ++++++++++++-------
 13 files changed, 93 insertions(+), 57 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index a7d91cb..3c9cd0e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,7 +7,7 @@
 
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS = src libs bindings tools examples
+SUBDIRS = src libs bindings po tools examples
 
 if ENABLE_TESTS
 SUBDIRS += tests
diff --git a/configure.ac b/configure.ac
index 9e08558..d19d041 100644
--- a/configure.ac
+++ b/configure.ac
@@ -269,14 +269,13 @@ GTK_DOC_CHECK([1.10],[--flavour no-tmpl])
 GOBJECT_INTROSPECTION_CHECK([0.9])
 
 # ----------------------------------------------------------
-# GETTEXT
+# GETTEXT/INTLTOOL
 # ----------------------------------------------------------
 
-#GETTEXT_PACKAGE=grilo
-#AC_SUBST(GETTEXT_PACKAGE)
-#AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
-
-#AM_GLIB_GNU_GETTEXT
+IT_PROG_INTLTOOL([0.40.0])
+GETTEXT_PACKAGE=grilo
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The domain to use with gettext])
 
 # ----------------------------------------------------------
 # WORKAROUNDS
@@ -298,6 +297,8 @@ AC_CONFIG_FILES([
   grilo-uninstalled.pc
   grilo-0.2.pc
   src/Makefile
+  po/Makefile.in
+  po/Makefile
   tests/Makefile
   tests/python/Makefile
   tests/python/util.py
diff --git a/libs/net/Makefile.am b/libs/net/Makefile.am
index 703cc6e..6e0e262 100644
--- a/libs/net/Makefile.am
+++ b/libs/net/Makefile.am
@@ -19,6 +19,7 @@ libgrlnet_ GRL_MAJORMINOR@_la_SOURCES = \
 libgrlnet_ GRL_MAJORMINOR@_la_CFLAGS = \
        -I $(top_srcdir)/src            \
        -I $(top_srcdir)/src/data       \
+       -DLOCALEDIR=\"$(localedir)\" \
        $(DEPS_CFLAGS)                  \
        $(NET_CFLAGS)
 
diff --git a/libs/net/grl-net-mock.c b/libs/net/grl-net-mock.c
index 9247e34..6b51e33 100644
--- a/libs/net/grl-net-mock.c
+++ b/libs/net/grl-net-mock.c
@@ -25,6 +25,7 @@
 #include "config.h"
 #endif
 
+#include <glib/gi18n-lib.h>
 #include <glib/gstdio.h>
 #include <gio/gio.h>
 #include <libsoup/soup.h>
@@ -76,7 +77,7 @@ get_url_mocked (GrlNetWc *self,
                                      GRL_NET_WC_ERROR,
                                      GRL_NET_WC_ERROR_NETWORK_ERROR,
                                      "%s",
-                                     "No mock definition found");
+                                     _("No mock definition found"));
     g_simple_async_result_complete_in_idle (G_SIMPLE_ASYNC_RESULT (result));
     return;
   }
@@ -86,7 +87,7 @@ get_url_mocked (GrlNetWc *self,
     g_simple_async_result_set_error (G_SIMPLE_ASYNC_RESULT (result),
                                      GRL_NET_WC_ERROR,
                                      GRL_NET_WC_ERROR_NOT_FOUND,
-                                     "Could not find mock content: %s",
+                                     _("Could not find mock content %s"),
                                      error->message);
     g_error_free (error);
     g_simple_async_result_complete_in_idle (G_SIMPLE_ASYNC_RESULT (result));
@@ -104,7 +105,7 @@ get_url_mocked (GrlNetWc *self,
                                      GRL_NET_WC_ERROR,
                                      GRL_NET_WC_ERROR_NOT_FOUND,
                                      "%s",
-                                     "Could not access mock content");
+                                     _("Could not access mock content"));
     g_simple_async_result_complete_in_idle (G_SIMPLE_ASYNC_RESULT (result));
     if (data_file)
       g_free (data_file);
diff --git a/libs/net/grl-net-private.c b/libs/net/grl-net-private.c
index 13b2e72..af0aa05 100644
--- a/libs/net/grl-net-private.c
+++ b/libs/net/grl-net-private.c
@@ -31,6 +31,7 @@
 #include "grl-net-private.h"
 #include "grl-net-mock-private.h"
 
+#include <glib/gi18n-lib.h>
 #include <glib/gstdio.h>
 #include <errno.h>
 
@@ -52,48 +53,48 @@ parse_error (guint status,
   case SOUP_STATUS_IO_ERROR:
     g_simple_async_result_set_error (result, GRL_NET_WC_ERROR,
                                      GRL_NET_WC_ERROR_NETWORK_ERROR,
-                                     "Cannot connect to the server");
+                                     _("Cannot connect to the server"));
     return;
   case SOUP_STATUS_CANT_RESOLVE_PROXY:
   case SOUP_STATUS_CANT_CONNECT_PROXY:
     g_simple_async_result_set_error (result, GRL_NET_WC_ERROR,
                                      GRL_NET_WC_ERROR_PROXY_ERROR,
-                                     "Cannot connect to the proxy server");
+                                     _("Cannot connect to the proxy server"));
     return;
   case SOUP_STATUS_INTERNAL_SERVER_ERROR: /* 500 */
   case SOUP_STATUS_MALFORMED:
   case SOUP_STATUS_BAD_REQUEST: /* 400 */
     g_simple_async_result_set_error (result, GRL_NET_WC_ERROR,
                                      GRL_NET_WC_ERROR_PROTOCOL_ERROR,
-                                     "Invalid request URI or header: %s",
+                                     _("Invalid request URI or header: %s"),
                                      response);
     return;
   case SOUP_STATUS_UNAUTHORIZED: /* 401 */
   case SOUP_STATUS_FORBIDDEN: /* 403 */
     g_simple_async_result_set_error (result, GRL_NET_WC_ERROR,
                                      GRL_NET_WC_ERROR_AUTHENTICATION_REQUIRED,
-                                     "Authentication required: %s", response);
+                                     _("Authentication required: %s"), response);
     return;
   case SOUP_STATUS_NOT_FOUND: /* 404 */
     g_simple_async_result_set_error (result, GRL_NET_WC_ERROR,
                                      GRL_NET_WC_ERROR_NOT_FOUND,
-                                     "The requested resource was not found: %s",
+                                     _("The requested resource was not found: %s"),
                                      response);
     return;
   case SOUP_STATUS_CONFLICT: /* 409 */
   case SOUP_STATUS_PRECONDITION_FAILED: /* 412 */
     g_simple_async_result_set_error (result, GRL_NET_WC_ERROR,
                                      GRL_NET_WC_ERROR_CONFLICT,
-                                     "The entry has been modified since it was downloaded: %s",
+                                     _("The entry has been modified since it was downloaded: %s"),
                                      response);
     return;
   case SOUP_STATUS_CANCELLED:
     g_simple_async_result_set_error (result, GRL_NET_WC_ERROR,
                                      GRL_NET_WC_ERROR_CANCELLED,
-                                     "Operation was cancelled");
+                                     _("Operation was cancelled"));
     return;
   default:
-    g_message ("Unhandled status: %s", soup_status_get_phrase (status));
+    g_message (_("Unhandled status: %s"), soup_status_get_phrase (status));
   }
 }
 
diff --git a/libs/net/grl-net-soup-stable.c b/libs/net/grl-net-soup-stable.c
index cdd615d..063f4a0 100644
--- a/libs/net/grl-net-soup-stable.c
+++ b/libs/net/grl-net-soup-stable.c
@@ -89,7 +89,7 @@ get_url_now (GrlNetWc *self,
     g_simple_async_result_set_error (G_SIMPLE_ASYNC_RESULT (result),
                                      GRL_NET_WC_ERROR,
                                      GRL_NET_WC_ERROR_PROTOCOL_ERROR,
-                                     "Malformed URL: %s", url);
+                                     _("Malformed URL %s"), url);
     g_simple_async_result_complete_in_idle (G_SIMPLE_ASYNC_RESULT (result));
     g_object_unref (result);
 
diff --git a/libs/net/grl-net-soup-unstable.c b/libs/net/grl-net-soup-unstable.c
index ce86baa..e64c784 100644
--- a/libs/net/grl-net-soup-unstable.c
+++ b/libs/net/grl-net-soup-unstable.c
@@ -32,6 +32,7 @@
 /* Using the cache feature requires to use the unstable API */
 #define LIBSOUP_USE_UNSTABLE_REQUEST_API
 
+#include <glib/gi18n-lib.h>
 #include <libsoup/soup-cache.h>
 #include <libsoup/soup-request-http.h>
 
@@ -184,11 +185,11 @@ read_async_cb (GObject *source,
     if (error->code == G_IO_ERROR_CANCELLED) {
       g_simple_async_result_set_error (result, GRL_NET_WC_ERROR,
                                        GRL_NET_WC_ERROR_CANCELLED,
-                                       "Operation was cancelled");
+                                       _("Operation was cancelled"));
     } else {
       g_simple_async_result_set_error (result, GRL_NET_WC_ERROR,
                                        GRL_NET_WC_ERROR_UNAVAILABLE,
-                                       "Data not available");
+                                       _("Data not available"));
     }
 
     g_error_free (error);
@@ -230,7 +231,7 @@ reply_cb (GObject *source,
   if (error) {
     g_simple_async_result_set_error (result, GRL_NET_WC_ERROR,
                                      GRL_NET_WC_ERROR_UNAVAILABLE,
-                                     "Data not available");
+                                     _("Data not available"));
     g_error_free (error);
 
     g_simple_async_result_complete (result);
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 0000000..e69de29
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..e682287
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,8 @@
+libs/net/grl-net-mock.c
+libs/net/grl-net-private.c
+libs/net/grl-net-soup-stable.c
+libs/net/grl-net-soup-unstable.c
+src/grilo.c
+src/grl-multiple.c
+src/grl-registry.c
+src/grl-source.c
diff --git a/src/Makefile.am b/src/Makefile.am
index e4aeb63..90e9667 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -31,6 +31,7 @@ lib GRL_NAME@_la_CFLAGS =     \
        $(DEPS_CFLAGS)          \
        -I$(srcdir)             \
        -I$(srcdir)/data        \
+       -DLOCALEDIR=\"$(localedir)\" \
        -DGRILO_COMPILATION     \
        -DG_LOG_DOMAIN=\"Grilo\"
 
diff --git a/src/grilo.c b/src/grilo.c
index 7bea0ee..2ea8bf3 100644
--- a/src/grilo.c
+++ b/src/grilo.c
@@ -40,6 +40,8 @@
 #include "grl-log-priv.h"
 #include "config.h"
 
+#include <glib/gi18n-lib.h>
+
 static gboolean grl_initialized = FALSE;
 static const gchar *plugin_path = NULL;
 static const gchar *plugin_list = NULL;
@@ -93,6 +95,10 @@ grl_init (gint *argc,
   g_type_init ();
 #endif
 
+  /* Initialize i18n */
+  bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+
   /* Initialize operations */
   grl_operation_init ();
 
@@ -172,18 +178,18 @@ grl_init_get_option_group (void)
   static const GOptionEntry grl_args[] = {
     { "grl-plugin-path", 0, 0, G_OPTION_ARG_STRING, &plugin_path,
 #ifdef G_OS_WIN32
-      "Semicolon-separated paths containing Grilo plugins", NULL },
+      N_("Semicolon-separated paths containing Grilo plugins"), NULL },
 #else
-      "Colon-separated paths containing Grilo plugins", NULL },
+      N_("Colon-separated paths containing Grilo plugins"), NULL },
 #endif
     { "grl-plugin-use", 0, 0, G_OPTION_ARG_STRING, &plugin_list,
-      "Colon-separated list of Grilo plugins to use", NULL },
+      N_("Colon-separated list of Grilo plugins to use"), NULL },
     { NULL }
   };
 
   group = g_option_group_new ("grl",
-                              "Grilo Options:",
-                              "Show Grilo Options",
+                              _("Grilo Options"),
+                              _("Show Grilo Options"),
                               NULL,
                               NULL);
   g_option_group_add_entries (group, grl_args);
diff --git a/src/grl-multiple.c b/src/grl-multiple.c
index 4300c61..1c78d22 100644
--- a/src/grl-multiple.c
+++ b/src/grl-multiple.c
@@ -34,6 +34,11 @@
  */
 
 #include "grl-multiple.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "grl-sync-priv.h"
 #include "grl-operation.h"
 #include "grl-operation-priv.h"
@@ -41,6 +46,8 @@
 #include "grl-error.h"
 #include "grl-log.h"
 
+#include <glib/gi18n-lib.h>
+
 #define GRL_LOG_DOMAIN_DEFAULT  multiple_log_domain
 GRL_LOG_DOMAIN(multiple_log_domain);
 
@@ -120,7 +127,7 @@ handle_no_searchable_sources_idle (gpointer user_data)
   struct CallbackData *callback_data = (struct CallbackData *) user_data;
 
   error = g_error_new (GRL_CORE_ERROR, GRL_CORE_ERROR_SEARCH_FAILED,
-                       "No searchable sources available");
+                       _("No searchable sources available"));
   callback_data->user_callback (NULL, 0, NULL, 0, callback_data->user_data, error);
 
   g_error_free (error);
@@ -477,9 +484,9 @@ media_from_uri_cb (GrlSource *source,
     mfucd->user_callback (source, 0, media, mfucd->user_data, NULL);
   } else {
     GError *_error = g_error_new (GRL_CORE_ERROR,
-                                 GRL_CORE_ERROR_MEDIA_FROM_URI_FAILED,
-                                 "Could not resolve media for URI '%s'",
-                                 mfucd->uri);
+                                  GRL_CORE_ERROR_MEDIA_FROM_URI_FAILED,
+                                  _("Could not resolve media for URI '%s'"),
+                                  mfucd->uri);
 
     mfucd->user_callback (source, 0, media, mfucd->user_data, _error);
     g_error_free (_error);
diff --git a/src/grl-registry.c b/src/grl-registry.c
index b9a7e2c..124a979 100644
--- a/src/grl-registry.c
+++ b/src/grl-registry.c
@@ -38,11 +38,17 @@
  */
 
 #include "grl-registry.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "grl-registry-priv.h"
 #include "grl-plugin-priv.h"
 #include "grl-log.h"
 #include "grl-error.h"
 
+#include <glib/gi18n-lib.h>
 #include <string.h>
 #include <gmodule.h>
 #include <libxml/parser.h>
@@ -319,7 +325,7 @@ activate_plugin (GrlRegistry *registry,
     g_set_error (error,
                  GRL_CORE_ERROR,
                  GRL_CORE_ERROR_LOAD_PLUGIN_FAILED,
-                 "Plugin '%s' is already loaded", grl_plugin_get_id (plugin));
+                 _("Plugin '%s' is already loaded"), grl_plugin_get_id (plugin));
     return FALSE;
   }
 
@@ -327,11 +333,11 @@ activate_plugin (GrlRegistry *registry,
                                         grl_plugin_get_id (plugin));
 
   if (!grl_plugin_load (plugin, plugin_configs)) {
-    GRL_DEBUG ("Failed to initialize plugin: '%s'. Check if plugin is well configured", 
grl_plugin_get_filename (plugin));
+    GRL_DEBUG ("Failed to initialize plugin from %s. Check if plugin is well configured", 
grl_plugin_get_filename (plugin));
     g_set_error (error,
                  GRL_CORE_ERROR,
                  GRL_CORE_ERROR_LOAD_PLUGIN_FAILED,
-                 "Failed to initialize plugin at '%s'", grl_plugin_get_filename (plugin));
+                 _("Failed to initialize plugin from %so"), grl_plugin_get_filename (plugin));
     g_module_close (grl_plugin_get_module (plugin));
     grl_plugin_set_module (plugin, NULL);
     return FALSE;
@@ -725,7 +731,7 @@ grl_registry_unregister_source (GrlRegistry *registry,
     g_set_error (error,
                  GRL_CORE_ERROR,
                  GRL_CORE_ERROR_UNREGISTER_SOURCE_FAILED,
-                 "Source with id '%s' was not found", id);
+                 _("Source with id '%s' was not found"), id);
     ret = FALSE;
   }
 
@@ -788,16 +794,16 @@ grl_registry_load_plugin (GrlRegistry *registry,
     g_set_error (error,
                  GRL_CORE_ERROR,
                  GRL_CORE_ERROR_LOAD_PLUGIN_FAILED,
-                 "Failed to load plugin at '%s'", library_filename);
+                 _("Failed to load plugin from %s"), library_filename);
     return FALSE;
   }
 
   if (!g_module_symbol (module, "GRL_PLUGIN_DESCRIPTOR", (gpointer) &plugin_desc)) {
-    GRL_WARNING ("Did not find plugin descriptor: '%s'", library_filename);
+    GRL_WARNING ("Plugin descriptor not found in '%s'", library_filename);
     g_set_error (error,
                  GRL_CORE_ERROR,
                  GRL_CORE_ERROR_LOAD_PLUGIN_FAILED,
-                 "'%s' is not a valid plugin file", library_filename);
+                 _("Invalid plugin file %s"), library_filename);
     g_module_close (module);
     return FALSE;
   }
@@ -808,7 +814,7 @@ grl_registry_load_plugin (GrlRegistry *registry,
     g_set_error (error,
                  GRL_CORE_ERROR,
                  GRL_CORE_ERROR_LOAD_PLUGIN_FAILED,
-                 "'%s' is not a valid plugin file", library_filename);
+                 _("'%s' is not a valid plugin file"), library_filename);
     g_module_close (module);
     return FALSE;
   }
@@ -827,7 +833,7 @@ grl_registry_load_plugin (GrlRegistry *registry,
       g_set_error (error,
                    GRL_CORE_ERROR,
                    GRL_CORE_ERROR_LOAD_PLUGIN_FAILED,
-                   "Unable to load plugin '%s'", plugin_desc->plugin_id);
+                   _("Unable to load plugin '%s'"), plugin_desc->plugin_id);
       g_module_close (module);
       return FALSE;
     }
@@ -838,7 +844,7 @@ grl_registry_load_plugin (GrlRegistry *registry,
       g_set_error (error,
                    GRL_CORE_ERROR,
                    GRL_CORE_ERROR_LOAD_PLUGIN_FAILED,
-                   "Plugin '%s' already exists", library_filename);
+                   _("Plugin '%s' already exists"), library_filename);
       return FALSE;
     }
   }
@@ -935,8 +941,7 @@ grl_registry_load_all_plugins (GrlRegistry *registry, GError **error)
     g_set_error (error,
                  GRL_CORE_ERROR,
                  GRL_CORE_ERROR_LOAD_PLUGIN_FAILED,
-                 "All configured plugin paths are invalid. "   \
-                 "Failed to load plugins.");
+                 _("All configured plugin paths are invalid"));
   }
 
   return loaded_one;
@@ -983,7 +988,7 @@ grl_registry_load_plugin_by_id (GrlRegistry *registry,
     g_set_error (error,
                  GRL_CORE_ERROR,
                  GRL_CORE_ERROR_LOAD_PLUGIN_FAILED,
-                 "Plugin '%s' not available", plugin_id);
+                 _("Plugin '%s' not available"), plugin_id);
     return FALSE;
   }
 
@@ -994,7 +999,7 @@ grl_registry_load_plugin_by_id (GrlRegistry *registry,
     g_set_error (error,
                  GRL_CORE_ERROR,
                  GRL_CORE_ERROR_LOAD_PLUGIN_FAILED,
-                 "Plugin '%s' is already loaded", plugin_id);
+                 _("Plugin '%s' is already loaded"), plugin_id);
     return FALSE;
   }
 
@@ -1204,7 +1209,7 @@ grl_registry_unload_plugin (GrlRegistry *registry,
     g_set_error (error,
                  GRL_CORE_ERROR,
                  GRL_CORE_ERROR_UNLOAD_PLUGIN_FAILED,
-                 "Plugin not found: '%s'", plugin_id);
+                 _("Plugin not found: '%s'"), plugin_id);
     return FALSE;
   }
 
@@ -1286,7 +1291,7 @@ grl_registry_register_metadata_key_full (GrlRegistry *registry,
     g_set_error (error,
                  GRL_CORE_ERROR,
                  GRL_CORE_ERROR_REGISTER_METADATA_KEY_FAILED,
-                 "Metadata key '%s' cannot be registered",
+                 _("Metadata key '%s' cannot be registered"),
                  key_name);
 
     return GRL_METADATA_KEY_INVALID;
@@ -1577,8 +1582,7 @@ grl_registry_add_config (GrlRegistry *registry,
     g_set_error (error,
                  GRL_CORE_ERROR,
                  GRL_CORE_ERROR_CONFIG_FAILED,
-                 "Plugin configuration does not contain "       \
-                 "plugin-id reference");
+                 _("Plugin configuration does not contain 'plugin-id' reference"));
     return FALSE;
   }
 
diff --git a/src/grl-source.c b/src/grl-source.c
index ce5e283..f09402a 100644
--- a/src/grl-source.c
+++ b/src/grl-source.c
@@ -34,6 +34,10 @@
 
 #include "grl-source.h"
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "grl-operation.h"
 #include "grl-operation-priv.h"
 #include "grl-marshal.h"
@@ -44,6 +48,7 @@
 #include "grl-log.h"
 #include "data/grl-media.h"
 
+#include <glib/gi18n-lib.h>
 #include <string.h>
 
 #define GRL_LOG_DOMAIN_DEFAULT  source_log_domain
@@ -1706,7 +1711,7 @@ media_decorate_cb (GrlSource *source,
     if (mdd->cancelled) {
       _error = g_error_new (GRL_CORE_ERROR,
                             GRL_CORE_ERROR_OPERATION_CANCELLED,
-                            "Operation was cancelled");
+                            _("Operation was cancelled"));
     }
     mdd->callback (media, mdd->user_data, _error);
     if (_error) {
@@ -1803,7 +1808,7 @@ media_from_uri_result_relay_cb (GrlSource *source,
     GRL_DEBUG ("operation was cancelled");
     _error = g_error_new (GRL_CORE_ERROR,
                           GRL_CORE_ERROR_OPERATION_CANCELLED,
-                          "Operation was cancelled");
+                          _("Operation was cancelled"));
   }
 
   if (_error) {
@@ -1946,7 +1951,7 @@ queue_process (gpointer user_data)
       if (qelement->remaining == 0) {
         error = g_error_new (GRL_CORE_ERROR,
                              GRL_CORE_ERROR_OPERATION_CANCELLED,
-                             "Operation was cancelled");
+                             _("Operation was cancelled"));
         brc->user_callback (brc->source, brc->operation_id, NULL,
                             0, brc->user_data, error);
         g_error_free (error);
@@ -2190,7 +2195,7 @@ browse_result_relay_cb (GrlSource *source,
     } else {
       _error = g_error_new (GRL_CORE_ERROR,
                             GRL_CORE_ERROR_OPERATION_CANCELLED,
-                            "Operation was cancelled");
+                            _("Operation was cancelled"));
       brc->user_callback (source, operation_id, NULL, 0,
                           brc->user_data, _error);
       g_error_free (_error);
@@ -2311,7 +2316,7 @@ resolve_all_done (gpointer user_data)
     }
     rrc->error = g_error_new (GRL_CORE_ERROR,
                               GRL_CORE_ERROR_OPERATION_CANCELLED,
-                              "Operation was cancelled");
+                              _("Operation was cancelled"));
   }
 
   rrc->user_callback (rrc->source, rrc->operation_id, rrc->media, rrc->user_data, rrc->error);
@@ -2641,7 +2646,7 @@ store_metadata_ctl_cb (GrlSource *source,
       if (smrc->failed_keys) {
         own_error = g_error_new (GRL_CORE_ERROR,
                                  GRL_CORE_ERROR_STORE_METADATA_FAILED,
-                                 "Some keys could not be written");
+                                 _("Some keys could not be written"));
       }
       smrc->user_callback (smrc->source,
                            media,
@@ -2715,7 +2720,7 @@ run_store_metadata (GrlSource *source,
   if (g_hash_table_size (map) == 0) {
     error = g_error_new (GRL_CORE_ERROR,
                          GRL_CORE_ERROR_STORE_METADATA_FAILED,
-                         "None of the specified keys is writable");
+                         _("None of the specified keys are writable"));
     if (callback) {
       callback (source, media, failed_keys, user_data, error);
     }
@@ -4006,7 +4011,7 @@ grl_source_store_remove_impl (GrlSource *source,
   if (!id) {
     rrc->error = g_error_new (GRL_CORE_ERROR,
                               GRL_CORE_ERROR_REMOVE_FAILED,
-                              "Media has no id, cannot remove");
+                              _("Media has no 'id', cannot remove"));
     rrc->spec = NULL;
   } else {
     rrc->error = NULL;


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