[epiphany/tls-errors] Avoid using markup in translatable strings



commit 21d4cd0a1322883ff428d4a97f438ba6acb4126b
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Mon Jul 7 17:33:40 2014 -0500

    Avoid using markup in translatable strings

 embed/ephy-web-view.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 6b0a17e..fe66ce9 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1879,6 +1879,8 @@ tls_error_cb (WebKitWebView *web_view,
   const char *uri;
   char *lang;
   char *page_title;
+  char *fancy_host;
+  char *warning;
   char *msg;
   char *stylesheet;
   GBytes *html_file;
@@ -1898,14 +1900,16 @@ tls_error_cb (WebKitWebView *web_view,
 
   stylesheet = get_style_sheet ();
 
-  /* Message when a site's TLS certificate is invalid. The %s is the site's URL. */
-  msg = g_strdup_printf (_("<p>This might not be the real <strong>%s</strong>.</p>"
-                           "<p>When you try to connect securely, web sites present "
+  fancy_host = g_strconcat ("<strong>", host, "</strong>", NULL);
+  /* Message when a site's TLS certificate is invalid. %s is the site's hostname. */
+  warning = g_strdup_printf (_("This might not be the real %s."), fancy_host);
+  msg = g_strdup_printf ("<p>%s</p><p>%s</p>", warning,
+                         /* Message when a site's TLS certificate is invalid. */
+                         _("When you try to connect securely, web sites present "
                            "identification to prove that your connection has not been "
                            "maliciously intercepted. There is something wrong with "
                            "this site’s identification. A criminal organization or "
-                           "government agency may have hijacked your connection.</p>"),
-                         host);
+                           "government agency may have hijacked your connection."));
 
   g_string_printf (html,
                    g_bytes_get_data (html_file, NULL),
@@ -1918,6 +1922,8 @@ tls_error_cb (WebKitWebView *web_view,
 
   g_bytes_unref (html_file);
   g_free (msg);
+  g_free (warning);
+  g_free (fancy_host);
   g_free (stylesheet);
   g_free (lang);
   g_free (page_title);


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