[libpeas] Be more explicit about a string's message
- From: Garrett Regier <gregier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas] Be more explicit about a string's message
- Date: Mon, 27 Apr 2015 14:16:53 +0000 (UTC)
commit bf58b9ca98c7bde43aea9fc41edc8c131121f746
Author: Garrett Regier <garrettregier gmail com>
Date: Sun Mar 29 20:30:02 2015 -0700
Be more explicit about a string's message
While trying to avoid having the markup be
translated it caused some translations to be incorrect.
In the case which was noticed, the space after the colon
was missing in various translations.
libpeas-gtk/peas-gtk-plugin-manager-view.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/libpeas-gtk/peas-gtk-plugin-manager-view.c b/libpeas-gtk/peas-gtk-plugin-manager-view.c
index 134b3d5..c4d0c3f 100644
--- a/libpeas-gtk/peas-gtk-plugin-manager-view.c
+++ b/libpeas-gtk/peas-gtk-plugin-manager-view.c
@@ -613,7 +613,7 @@ peas_gtk_plugin_manager_view_query_tooltip (GtkWidget *widget,
gboolean is_row;
GtkTreeIter iter;
PeasPluginInfo *info;
- gchar *to_bold, *message;
+ gchar *to_bold, *error_msg, *message;
GError *error = NULL;
is_row = gtk_tree_view_get_tooltip_context (GTK_TREE_VIEW (widget),
@@ -633,14 +633,18 @@ peas_gtk_plugin_manager_view_query_tooltip (GtkWidget *widget,
/* Avoid having markup in a translated string */
to_bold = g_strdup_printf (_("The plugin '%s' could not be loaded"),
peas_plugin_info_get_name (info));
- message = g_markup_printf_escaped ("<b>%s</b>\n%s%s",
- to_bold,
- _("An error occurred: "),
- error->message);
+
+ /* Keep separate because some translations do special things
+ * for the ':' and might accidentally not keep the space after it
+ */
+ error_msg = g_strdup_printf (_("An error occurred: %s"), error->message);
+
+ message = g_strconcat ("<b>", to_bold, "</b>\n", error_msg, NULL);
gtk_tooltip_set_markup (tooltip, message);
g_free (message);
+ g_free (error_msg);
g_free (to_bold);
g_error_free (error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]