From cf3decd2e830b53569e8dd9c12c2469914eb9b21 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Wed, 27 Sep 2006 00:30:46 +0200 Subject: * Make some strings translatable - seems that gettext doesn't like being part of string addition. the other one was my fault and not the one of gettext. fix #62519 and #62458 * Fix the imports and calls of human_size --- UpdateManager/Common/utils.py | 3 ++- UpdateManager/GtkProgress.py | 2 +- UpdateManager/UpdateManager.py | 16 ++++++++-------- po/POTFILES.in | 1 + 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/UpdateManager/Common/utils.py b/UpdateManager/Common/utils.py index 95440e44..fa73b8bd 100644 --- a/UpdateManager/Common/utils.py +++ b/UpdateManager/Common/utils.py @@ -1,4 +1,5 @@ import gtk +from gettext import gettext as _ def str_to_bool(str): if str == "0" or str.upper() == "FALSE": @@ -22,7 +23,7 @@ def error(parent, summary, message): d.destroy() return -def humanize_size(self, bytes): +def humanize_size(bytes): """ Convert a given size in bytes to a nicer better readable unit """ diff --git a/UpdateManager/GtkProgress.py b/UpdateManager/GtkProgress.py index cdc761fc..cb635e87 100644 --- a/UpdateManager/GtkProgress.py +++ b/UpdateManager/GtkProgress.py @@ -25,7 +25,7 @@ import gtk import apt import apt_pkg from gettext import gettext as _ -from common.utils import * +from Common.utils import * # intervals of the start up progress # 3x caching and menu creation diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index 2bb95b2f..02a89a40 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -592,8 +592,8 @@ class UpdateManager(SimpleGladeApp): self.button_install.set_sensitive(self.cache.installCount) self.dl_size = self.cache.requiredDownload # TRANSLATORS: b stands for Bytes - self.label_downsize.set_markup(_("Download size: %s" % \ - humanize_size(self.dl_size))) + self.label_downsize.set_markup(_("Download size: %s") % \ + humanize_size(self.dl_size)) def update_count(self): """activate or disable widgets and show dialog texts correspoding to @@ -601,7 +601,7 @@ class UpdateManager(SimpleGladeApp): self.refresh_updates_count() num_updates = self.cache.installCount if num_updates == 0: - text_header= ""+_("Your system is up-to-date")+"" + text_header= "%s" + text_header = "%s" % \ + (gettext.ngettext("You can install %s update", + "You can install %s updates", + num_updates) % \ + num_updates) text_download = _("Download size: %s") % humanize_size(self.dl_size) self.notebook_details.set_sensitive(True) self.treeview_update.set_sensitive(True) diff --git a/po/POTFILES.in b/po/POTFILES.in index b383e84c..64774c4e 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -12,6 +12,7 @@ UpdateManager/fakegconf.py UpdateManager/ReleaseNotesViewer.py UpdateManager/GtkProgress.py UpdateManager/UpdateManager.py +UpdateManager/Common/utils.py data/mime/apt.xml.in data/glade/UpdateManager.glade data/glade/SoftwareProperties.glade -- cgit v1.2.3