From fdd68b3d1577af90bd37d990ac09ba8b5ee2f70d Mon Sep 17 00:00:00 2001 From: infirit Date: Fri, 19 Dec 2014 01:17:13 +0100 Subject: Remove markup from translated strings Including the markup in the translated strings makes the translators job unnecessarily harder. Taken from GSM commit: c45ed812a74874ada38feaf4883de807d2a26cfb From: Matthias Clasen Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=681271 --- src/lsof.cpp | 8 +++++--- src/sysinfo.cpp | 4 ++-- src/util.cpp | 7 +++++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/lsof.cpp b/src/lsof.cpp index 100394a..aaf2fbd 100644 --- a/src/lsof.cpp +++ b/src/lsof.cpp @@ -122,10 +122,12 @@ namespace void display_regex_error(const Glib::RegexError& error) { - const char * msg = _("Error\n" - "'%s' is not a valid Perl regular expression.\n" - "%s"); + char * msg = g_strdup_printf ("%s\n%s\n%s", + _("Error"), + _("'%s' is not a valid Perl regular expression."), + "%s"); std::string message = make_string(g_strdup_printf(msg, this->pattern().c_str(), error.what().c_str())); + g_free(msg); Gtk::MessageDialog dialog(message, true, // use markup diff --git a/src/sysinfo.cpp b/src/sysinfo.cpp index 857570b..257baa1 100644 --- a/src/sysinfo.cpp +++ b/src/sysinfo.cpp @@ -806,7 +806,7 @@ procman_create_sysinfo_view(void) /* hardware section */ - markup = g_strdup_printf(_("Hardware")); + markup = g_strdup_printf("%s", _("Hardware")); hardware_table = add_section(GTK_BOX(vbox), markup, 1, 2, NULL); g_free(markup); @@ -823,7 +823,7 @@ procman_create_sysinfo_view(void) /* disk space section */ - markup = g_strdup_printf(_("System Status")); + markup = g_strdup_printf("%s", _("System Status")); disk_space_table = add_section(GTK_BOX(vbox), markup, 1, 2, NULL); g_free(markup); diff --git a/src/util.cpp b/src/util.cpp index cdb3287..3573f00 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -416,8 +416,11 @@ namespace procman g_value_unset(&value); - if (size == 0) - g_object_set(renderer, "markup", _("N/A"), NULL); + if (size == 0) { + char *str = g_strdup_printf ("%s", _("N/A")); + g_object_set(renderer, "markup", str, NULL); + g_free(str); + } else { char *str = procman::format_size(size); g_object_set(renderer, "text", str, NULL); -- cgit v1.2.1