[pitivi: 13/16] Handle plurals and singular for the warning infobar's label and button label



commit fd58be714bc12d4bb2d9a67ff5e17f7f204df346
Author: Jean-François Fortin Tam <nekohayo gmail com>
Date:   Mon Dec 27 00:37:38 2010 -0500

    Handle plurals and singular for the warning infobar's label and button label

 pitivi/ui/sourcelist.py |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/ui/sourcelist.py b/pitivi/ui/sourcelist.py
index 0846256..916df44 100644
--- a/pitivi/ui/sourcelist.py
+++ b/pitivi/ui/sourcelist.py
@@ -245,11 +245,11 @@ class SourceList(gtk.VBox, Loggable):
         self.import_warning_infobar.set_message_type(gtk.MESSAGE_WARNING)
         content_area = self.import_warning_infobar.get_content_area()
         actions_area = self.import_warning_infobar.get_action_area()
-        self.warning_label = gtk.Label(_("Errors occured during importing"))
+        self.warning_label = gtk.Label()
         self.warning_label.set_line_wrap(True)
         self.warning_label.set_line_wrap_mode(pango.WRAP_WORD)
         self.warning_label.set_justify(gtk.JUSTIFY_CENTER)
-        self.viewErrorsButton = gtk.Button(_("View errors"))
+        self.viewErrorsButton = gtk.Button()
         self.viewErrorsButton.connect("clicked", self._viewErrorsButtonClickedCb)
         content_area.add(self.warning_label)
         actions_area.add(self.viewErrorsButton)
@@ -640,6 +640,12 @@ class SourceList(gtk.VBox, Loggable):
     def _sourcesStoppedImportingCb(self, unused_sourcelist):
         self.progressbar.hide()
         if self.errors:
+            if len(self.errors) > 1:
+                self.warning_label.set_text(_("Errors occured while importing."))
+                self.viewErrorsButton.set_label(_("View errors"))
+            else:
+                self.warning_label.set_text(_("An error occured while importing."))
+                self.viewErrorsButton.set_label(_("View error"))
             self.import_warning_infobar.show_all()
 
     ## Error Dialog Box callbacks



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