]> Pileus Git - ~andy/gtk/commitdiff
Bug 571015 libprintbackend-cups has unlocalized strings
authorTakao Fujiwara <takao.fujiwara@sun.com>
Mon, 9 Feb 2009 05:39:37 +0000 (05:39 +0000)
committerTakao Fujiwara <fujiwarat@src.gnome.org>
Mon, 9 Feb 2009 05:39:37 +0000 (05:39 +0000)
2009-02-09  Takao Fujiwara  <takao.fujiwara@sun.com>

Bug 571015  libprintbackend-cups has unlocalized strings

Reviewed by Matthias Clasen  <mclasen@redhat.com>

* modules/printbackends/cups/gtkprintbackendcups.c (handle_option):
Add translatable strings from ppd files.

svn path=/trunk/; revision=22294

ChangeLog
modules/printbackends/cups/gtkprintbackendcups.c

index 6855185c684c389cf0be4dfc84b3f919761c5b7d..78dcd218660a5a8a46b42f7cf9b16d3637bb8190 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-02-09  Takao Fujiwara  <takao.fujiwara@sun.com>
+
+       Bug 571015 – libprintbackend-cups has unlocalized strings
+
+       Reviewed by Matthias Clasen  <mclasen@redhat.com>
+
+       * modules/printbackends/cups/gtkprintbackendcups.c (handle_option):
+       Add translatable strings from ppd files.
+
 2009-02-06  Matthias Clasen  <mclasen@redhat.com>
 
        Make the new GtkAction code work with PolicyKit-gnome's use of actions.
index 8bebff9482b4aa89bd072af0ff888a4c658bcce7..46cad200a0269739558f6d96968a05b2c28e8fc7 100644 (file)
@@ -2146,6 +2146,8 @@ static const struct {
   { "MediaType", N_("Paper Type") },
   { "InputSlot", N_("Paper Source") },
   { "OutputBin", N_("Output Tray") },
+  { "Resolution", N_("Resolution") },
+  { "PreFilter", N_("GhostScript pre-filtering") },
 };
 
 
@@ -2155,6 +2157,10 @@ static const struct {
   const char *translation;
 } cups_choice_translations[] = {
   { "Duplex", "None", N_("One Sided") },
+  /* Translators: this is an option of "Two Sided" */
+  { "Duplex", "DuplexNoTumble", N_("Long Edge (Standard)") },
+  /* Translators: this is an option of "Two Sided" */
+  { "Duplex", "DuplexTumble", N_("Short Edge (Flip)") },
   /* Translators: this is an option of "Paper Source" */
   { "InputSlot", "Auto", N_("Auto Select") },
   /* Translators: this is an option of "Paper Source" */
@@ -2167,6 +2173,23 @@ static const struct {
   { "InputSlot", "PrinterDefault", N_("Printer Default") },
   /* Translators: this is an option of "Paper Source" */
   { "InputSlot", "Unspecified", N_("Auto Select") },
+  /* Translators: this is an option of "Resolution" */
+  { "Resolution", "default", N_("Printer Default") },
+  /* Translators: this is an option of "GhostScript" */
+  { "PreFilter", "EmbedFonts", N_("Embed GhostScript fonts only") },
+  /* Translators: this is an option of "GhostScript" */
+  { "PreFilter", "Level1", N_("Convert to PS level 1") },
+  /* Translators: this is an option of "GhostScript" */
+  { "PreFilter", "Level2", N_("Convert to PS level 2") },
+  /* Translators: this is an option of "GhostScript" */
+  { "PreFilter", "No", N_("No pre-filtering") },
+};
+
+static const struct {
+  const char *name;
+  const char *translation;
+} cups_group_translations[] = {
+  { "Miscellaneous", N_("Miscellaneous") },
 };
 
 static const struct {
@@ -2734,6 +2757,7 @@ handle_option (GtkPrinterOptionSet *set,
 {
   GtkPrinterOption *option;
   char *name;
+  int i;
 
   if (STRING_IN_TABLE (ppd_option->keyword, cups_option_blacklist))
     return;
@@ -2782,7 +2806,17 @@ handle_option (GtkPrinterOptionSet *set,
        }
       else
        {
-         option->group = g_strdup (toplevel_group->text);
+         for (i = 0; i < G_N_ELEMENTS (cups_group_translations); i++)
+           {
+             if (strcmp (cups_group_translations[i].name, toplevel_group->name) == 0)
+               {
+                 option->group = g_strdup (_(cups_group_translations[i].translation));
+                 break;
+               }
+           }
+
+         if (i == G_N_ELEMENTS (cups_group_translations))
+           option->group = g_strdup (toplevel_group->text);
        }
 
       set_option_from_settings (option, settings);