Hi,

I was testing the GTK version of aptitude this weekend and have
noticed a small bug regarding localization.

If you have a list of packages displayed and you hover your mouse over
the status column, a tooltip pops up describing the current status and
a selected status.

When the "Selected status" description is empty, instead of an empty
string the header of the corresponding .po file is displayed.

If you have a look to the src/gtk/pkgview.cc, where the view is
constructed, the function selected_package_state_columns() on line 118
returns entity_state_info that has its description initiated to the
empty string.

When this empty string is handled further down line 172, gettext looks
up the corresponding string in .po file and returns the localized
string. Unfortunately, the empty string matches the dummy header
string in a .po file:

  msgid ""
  msgstr ""
  "Project-Id-Version: aptitude\n"
  "Report-Msgid-Bugs-To: [email protected]\n"
  ...

For obvious reasons this does not happen if you run aptitude with no
locale like, i.e. LANG=C aptitude.

I would suggest to introduce new entity_state_info called
no_action_columns and use some other description than empty string
(ehm, space is enough). Proof of code attached.

-- 
Miroslav Kure
diff -r 86de8639a734 src/gtk/gui.cc
--- a/src/gtk/gui.cc	Thu Jun 18 20:03:40 2009 -0700
+++ b/src/gtk/gui.cc	Sat Jun 20 17:29:41 2009 +0200
@@ -95,6 +95,7 @@
   const entity_state_info hold_columns("h", N_("Hold (don't upgrade)"), Gtk::Stock::MEDIA_PAUSE);
   const entity_state_info forbid_columns("F", N_("Forbidden version"), Gtk::Stock::STOP);
   const entity_state_info broken_columns("B", N_("Unsatisfied dependencies"), Gtk::Stock::DIALOG_ERROR);
+  const entity_state_info no_action_columns("", N_(" "), Gtk::StockID());
 
 
   const char *lightred_background_color = "#FFCCCC";
diff -r 86de8639a734 src/gtk/gui.h
--- a/src/gtk/gui.h	Thu Jun 18 20:03:40 2009 -0700
+++ b/src/gtk/gui.h	Sat Jun 20 17:29:41 2009 +0200
@@ -360,6 +360,7 @@
   extern const entity_state_info hold_columns;
   extern const entity_state_info forbid_columns;
   extern const entity_state_info broken_columns;
+  extern const entity_state_info no_action_columns;
 
   extern const char *lightred_background_color;
   extern const char *lightgreen_background_color;
diff -r 86de8639a734 src/gtk/pkgview.cc
--- a/src/gtk/pkgview.cc	Thu Jun 18 20:03:40 2009 -0700
+++ b/src/gtk/pkgview.cc	Sat Jun 20 17:29:41 2009 +0200
@@ -115,7 +115,7 @@
 	  return upgrade_columns;
       }
     else
-      return entity_state_info();
+      return no_action_columns;
   }
 
   string PkgEntity::selected_package_state_color()
_______________________________________________
Aptitude-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/aptitude-devel

Reply via email to