[gnome-builder] Fix l10n in Git plugin



commit 49a0347306142a6512d51b689fadf6d028b7cd9d
Author: Ricardo Silva Veloso <ricvelozo gmail com>
Date:   Tue Jan 14 23:09:20 2020 -0300

    Fix l10n in Git plugin

 src/plugins/git/daemon/ipc-git-change-monitor-impl.c | 8 +++++---
 src/plugins/git/daemon/ipc-git-remote-callbacks.c    | 2 +-
 src/plugins/git/daemon/ipc-git-repository-impl.c     | 5 +++--
 src/plugins/git/daemon/ipc-git-util.h                | 4 +++-
 src/plugins/git/gbp-git-buffer-change-monitor.c      | 3 ++-
 src/plugins/git/gbp-git-client.c                     | 3 ++-
 src/plugins/git/gbp-git-dependency-updater.c         | 2 +-
 src/plugins/git/gbp-git-vcs-cloner.c                 | 2 +-
 src/plugins/git/gbp-git-vcs.c                        | 2 +-
 9 files changed, 19 insertions(+), 12 deletions(-)
---
diff --git a/src/plugins/git/daemon/ipc-git-change-monitor-impl.c 
b/src/plugins/git/daemon/ipc-git-change-monitor-impl.c
index 8c53dd06f..ab24eb7fa 100644
--- a/src/plugins/git/daemon/ipc-git-change-monitor-impl.c
+++ b/src/plugins/git/daemon/ipc-git-change-monitor-impl.c
@@ -20,6 +20,8 @@
 
 #define G_LOG_DOMAIN "ipc-git-change-monitor-impl"
 
+#include <glib/gi18n.h>
+
 #include "ipc-git-change-monitor-impl.h"
 #include "line-cache.h"
 
@@ -114,7 +116,7 @@ ipc_git_change_monitor_impl_load_blob (IpcGitChangeMonitorImpl  *self,
       g_set_error (error,
                    G_IO_ERROR,
                    G_IO_ERROR_FAILED,
-                   "No repository to access file contents");
+                   _("No repository to access file contents"));
       return NULL;
     }
 
@@ -182,7 +184,7 @@ ipc_git_change_monitor_impl_handle_list_changes (IpcGitChangeMonitor   *monitor,
       g_set_error (&error,
                    G_IO_ERROR,
                    G_IO_ERROR_NOT_INITIALIZED,
-                   "No contents have been set to diff");
+                   _("No contents have been set to diff"));
       goto gerror;
     }
 
@@ -259,7 +261,7 @@ gerror:
       g_set_error (&error,
                    G_IO_ERROR,
                    G_IO_ERROR_FAILED,
-                   "The operation failed. The original error was \"%s\"",
+                   _("The operation failed. The original error was \"%s\""),
                    wrapped->message);
     }
 
diff --git a/src/plugins/git/daemon/ipc-git-remote-callbacks.c 
b/src/plugins/git/daemon/ipc-git-remote-callbacks.c
index 58b2622ca..8c0473bcf 100644
--- a/src/plugins/git/daemon/ipc-git-remote-callbacks.c
+++ b/src/plugins/git/daemon/ipc-git-remote-callbacks.c
@@ -65,7 +65,7 @@ ipc_git_remote_callbacks_real_credentials (GgitRemoteCallbacks  *callbacks,
       g_set_error (error,
                    G_IO_ERROR,
                    G_IO_ERROR_CANCELLED,
-                   "The operation has been canceled");
+                   _("The operation has been canceled"));
       return NULL;
     }
 
diff --git a/src/plugins/git/daemon/ipc-git-repository-impl.c 
b/src/plugins/git/daemon/ipc-git-repository-impl.c
index 7f010427a..abcca5476 100644
--- a/src/plugins/git/daemon/ipc-git-repository-impl.c
+++ b/src/plugins/git/daemon/ipc-git-repository-impl.c
@@ -22,6 +22,7 @@
 
 #include <libgit2-glib/ggit.h>
 #include <git2.h>
+#include <glib/gi18n.h>
 #include <stdlib.h>
 
 #include "ipc-git-change-monitor-impl.h"
@@ -589,7 +590,7 @@ ipc_git_repository_impl_commit (IpcGitRepositoryImpl  *self,
       g_set_error (error,
                    G_IO_ERROR,
                    G_IO_ERROR_INVALID_DATA,
-                   "Cannot set AMEND and GPG_SIGN flags");
+                   _("Cannot set AMEND and GPG_SIGN flags"));
       return FALSE;
     }
 
@@ -598,7 +599,7 @@ ipc_git_repository_impl_commit (IpcGitRepositoryImpl  *self,
       g_set_error (error,
                    G_IO_ERROR,
                    G_IO_ERROR_INVALID_DATA,
-                   "Cannot sign commit without GPG_KEY_ID");
+                   _("Cannot sign commit without GPG_KEY_ID"));
       return FALSE;
     }
 
diff --git a/src/plugins/git/daemon/ipc-git-util.h b/src/plugins/git/daemon/ipc-git-util.h
index 915e4f8e4..f083c92d5 100644
--- a/src/plugins/git/daemon/ipc-git-util.h
+++ b/src/plugins/git/daemon/ipc-git-util.h
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include <glib/gi18n.h>
+
 static inline gboolean
 complete_wrapped_error (GDBusMethodInvocation *invocation,
                         const GError          *error)
@@ -28,7 +30,7 @@ complete_wrapped_error (GDBusMethodInvocation *invocation,
 
   wrapped = g_error_new (G_IO_ERROR,
                          G_IO_ERROR_FAILED,
-                         "The operation failed. The original error was \"%s\"",
+                         _("The operation failed. The original error was \"%s\""),
                          error->message);
   g_dbus_method_invocation_return_gerror (invocation, wrapped);
 
diff --git a/src/plugins/git/gbp-git-buffer-change-monitor.c b/src/plugins/git/gbp-git-buffer-change-monitor.c
index b7abb775d..4ef2e3a19 100644
--- a/src/plugins/git/gbp-git-buffer-change-monitor.c
+++ b/src/plugins/git/gbp-git-buffer-change-monitor.c
@@ -23,6 +23,7 @@
 #include "config.h"
 
 #include <dazzle.h>
+#include <glib/gi18n.h>
 #include <string.h>
 
 #include "daemon/ipc-git-change-monitor.h"
@@ -395,7 +396,7 @@ gbp_git_buffer_change_monitor_new (IdeBuffer         *buffer,
       g_set_error (error,
                    G_IO_ERROR,
                    G_IO_ERROR_NOT_SUPPORTED,
-                   "Cannot monitor files outside the working directory");
+                   _("Cannot monitor files outside the working directory"));
       return NULL;
     }
 
diff --git a/src/plugins/git/gbp-git-client.c b/src/plugins/git/gbp-git-client.c
index 48a868b2c..d5a40e22b 100644
--- a/src/plugins/git/gbp-git-client.c
+++ b/src/plugins/git/gbp-git-client.c
@@ -24,6 +24,7 @@
 
 #include <gio/gunixinputstream.h>
 #include <gio/gunixoutputstream.h>
+#include <glib/gi18n.h>
 #include <glib-unix.h>
 #include <libide-threading.h>
 
@@ -325,7 +326,7 @@ gbp_git_client_get_service_async (GbpGitClient        *self,
       ide_task_return_new_error (task,
                                  G_IO_ERROR,
                                  G_IO_ERROR_CLOSED,
-                                 "The client has been closed");
+                                 _("The client has been closed"));
       break;
 
     default:
diff --git a/src/plugins/git/gbp-git-dependency-updater.c b/src/plugins/git/gbp-git-dependency-updater.c
index 3d5ac00dc..ef12269d3 100644
--- a/src/plugins/git/gbp-git-dependency-updater.c
+++ b/src/plugins/git/gbp-git-dependency-updater.c
@@ -89,7 +89,7 @@ gbp_git_dependency_updater_update_async (IdeDependencyUpdater *self,
       ide_task_return_new_error (task,
                                  G_IO_ERROR,
                                  G_IO_ERROR_FAILED,
-                                 "Git version control is not in use");
+                                 _("Git version control is not in use"));
       IDE_EXIT;
     }
 
diff --git a/src/plugins/git/gbp-git-vcs-cloner.c b/src/plugins/git/gbp-git-vcs-cloner.c
index 648bcfda2..d96aba76d 100644
--- a/src/plugins/git/gbp-git-vcs-cloner.c
+++ b/src/plugins/git/gbp-git-vcs-cloner.c
@@ -130,7 +130,7 @@ gbp_git_vcs_cloner_validate_uri (IdeVcsCloner  *cloner,
           if (!g_file_query_exists (file, NULL))
             {
               if (errmsg != NULL)
-                *errmsg = g_strdup_printf ("A resository could not be found at ā€œ%sā€.", path);
+                *errmsg = g_strdup_printf (_("A resository could not be found at ā€œ%sā€."), path);
               return FALSE;
             }
 
diff --git a/src/plugins/git/gbp-git-vcs.c b/src/plugins/git/gbp-git-vcs.c
index 9be15f85a..f9cc2d8ba 100644
--- a/src/plugins/git/gbp-git-vcs.c
+++ b/src/plugins/git/gbp-git-vcs.c
@@ -505,7 +505,7 @@ gbp_git_vcs_list_status_async (IdeVcs              *vcs,
       ide_task_return_new_error (task,
                                  G_IO_ERROR,
                                  G_IO_ERROR_NOT_SUPPORTED,
-                                 "Directory is not within repository");
+                                 _("Directory is not within repository"));
       return;
     }
 


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