summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2016-04-15 12:13:34 +0200
committerBastien Nocera <hadess@hadess.net>2016-04-16 18:42:28 +0200
commita69e59132f723d5b90f5ab5cf8a2fb04b30c991b (patch)
tree7a46fe37a9ca55b94227a7a2b23aba8eec2fd2cd /modules
parentdfc26939cc4314e7c6f11bc83df25640944c0e31 (diff)
downloadgtk+-a69e59132f723d5b90f5ab5cf8a2fb04b30c991b.tar.gz
cups: Fix gettext usage
The previous patches didn't mark some strings as to be translated, and tried to translate strings with a variable part already inside the string, which isn't going to work. Mark the strings as translatable with context, and also make sure to translate static strings when getting them out of their structure. https://bugzilla.gnome.org/show_bug.cgi?id=764585
Diffstat (limited to 'modules')
-rw-r--r--modules/printbackends/cups/gtkprintbackendcups.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c
index 661037b227..9fd77d3a56 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
@@ -4409,40 +4409,37 @@ static const struct {
* Handles "format not a string literal" error
* https://mail.gnome.org/archives/desktop-devel-list/2016-March/msg00075.html
*/
-static const gchar *
+static gchar *
get_ipp_choice_translation_string (gint index,
guint i)
{
- const gchar *translation;
- gchar *string;
+ gchar *translation;
if (i < G_N_ELEMENTS (ipp_choice_translations))
- translation = ipp_choice_translations[i].translation;
+ translation = g_strdup (_(ipp_choice_translations[i].translation));
else
{
switch (i)
{
case 14:
/* Translators: Output stacker number %d */
- string = g_strdup_printf ("Stacker %d", index);
+ translation = g_strdup_printf (C_("output-bin", "Stacker %d"), index);
break;
case 15:
/* Translators: Output mailbox number %d */
- string = g_strdup_printf ("Mailbox %d", index);
+ translation = g_strdup_printf (C_("output-bin", "Mailbox %d"), index);
break;
case 16:
/* Translators: Private mailbox */
- string = g_strdup ("My Mailbox");
+ translation = g_strdup (C_("output-bin", "My Mailbox"));
break;
case 17:
/* Translators: Output tray number %d */
- string = g_strdup_printf ("Tray %d", index);
+ translation = g_strdup_printf (C_("output-bin", "Tray %d"), index);
break;
default:
g_assert_not_reached ();
}
-
- translation = g_dpgettext2 (GETTEXT_PACKAGE, "output-bin", string);
}
return translation;
@@ -5206,9 +5203,7 @@ get_ipp_choice_translation (const gchar *ipp_option_name,
if (index != 0 || endptr != nptr)
{
- translation = g_strdup (g_dpgettext2 (GETTEXT_PACKAGE,
- ipp_option_name,
- get_ipp_choice_translation_string (index, i)));
+ translation = get_ipp_choice_translation_string (index, i);
break;
}
}