From: Bruno Haible Date: Mon, 16 Dec 2024 14:31:39 +0000 (+0100) Subject: hello-c-gnome3: Avoid translator mistakes regarding markup (e.g. in de.po). X-Git-Tag: v0.24~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f0372f6d35bdbec7fa49a8994b30797a4f64077;p=thirdparty%2Fgettext.git hello-c-gnome3: Avoid translator mistakes regarding markup (e.g. in de.po). * gettext-tools/examples/hello-c-gnome3/hello.c (hello_application_window_init): Move HTML markup outside of translatable strings. --- diff --git a/gettext-tools/examples/hello-c-gnome3/hello.c b/gettext-tools/examples/hello-c-gnome3/hello.c index f7a7a801c..5f8a315b1 100644 --- a/gettext-tools/examples/hello-c-gnome3/hello.c +++ b/gettext-tools/examples/hello-c-gnome3/hello.c @@ -80,15 +80,15 @@ hello_application_window_init (HelloApplicationWindow *window) window->label, "use-markup", G_SETTINGS_BIND_DEFAULT); - window->labels[0] - = g_strdup_printf (_("Hello world!\n" - "This program is running as " - "process number %d."), - getpid ()); + gchar *line1 = g_strdup_printf ("%s", _("Hello world!")); + gchar *line2 = + g_strdup_printf (_("This program is running as process number %s."), + g_strdup_printf ("%d", getpid ())); + window->labels[0] = g_strdup_printf ("%s\n%s", line1, line2); window->labels[1] - = g_strdup (_("This is another text")); + = g_strdup_printf ("%s", _("This is another text")); window->labels[2] - = g_strdup (_("This is yet another text")); + = g_strdup_printf ("%s", _("This is yet another text")); update_content (window); }