summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-09-29 17:00:29 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-09-29 17:00:29 +0200
commitd74718143cd630e09ee14f5a2fb946b86266cb37 (patch)
tree7509d730c14e38838e26acaf7e4f150837c464ed
parente40dd39c6ad5b1d29644430cdecdfc02bf674a8a (diff)
parentb9dffe7bcfab1807249821bacb8b39e83d20d5eb (diff)
downloadpython-apt-d74718143cd630e09ee14f5a2fb946b86266cb37.tar.gz
* merged from glatzor
-rw-r--r--SoftwareProperties/SoftwareProperties.py3
-rw-r--r--UpdateManager/Common/utils.py19
-rw-r--r--UpdateManager/GtkProgress.py13
-rw-r--r--UpdateManager/UpdateManager.py51
-rw-r--r--debian/changelog1
-rw-r--r--po/POTFILES.in1
6 files changed, 49 insertions, 39 deletions
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index 1c8a3425..14ddeefc 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -482,6 +482,9 @@ class SoftwareProperties(SimpleGladeApp):
for source in self.distro.child_sources:
if source.template == template:
self.sourceslist.remove(source)
+ for source in self.distro.source_code_sources:
+ if source.template == template:
+ self.sourceslist.remove(source)
else:
self.distro.add_source(self.sourceslist,
uri=template.base_uri,
diff --git a/UpdateManager/Common/utils.py b/UpdateManager/Common/utils.py
index 099cbfed..1fcd022f 100644
--- a/UpdateManager/Common/utils.py
+++ b/UpdateManager/Common/utils.py
@@ -1,4 +1,6 @@
import gtk
+from gettext import gettext as _
+import locale
def str_to_bool(str):
if str == "0" or str.upper() == "FALSE":
@@ -21,3 +23,20 @@ def error(parent, summary, message):
res = d.run()
d.destroy()
return
+
+def humanize_size(bytes):
+ """
+ Convert a given size in bytes to a nicer better readable unit
+ """
+ if bytes == 0:
+ # TRANSLATORS: download size is 0
+ return _("None")
+ elif bytes < 1024:
+ # TRANSLATORS: download size of very small updates
+ return _("1 KB")
+ elif bytes < 1024 * 1024:
+ # TRANSLATORS: download size of small updates, e.g. "250 KB"
+ return locale.format(_("%.0f KB"), bytes/1024)
+ else:
+ # TRANSLATORS: download size of updates, e.g. "2.3 MB"
+ return locale.format(_("%.1f MB"), bytes / 1024 / 1024)
diff --git a/UpdateManager/GtkProgress.py b/UpdateManager/GtkProgress.py
index 54f60384..cb635e87 100644
--- a/UpdateManager/GtkProgress.py
+++ b/UpdateManager/GtkProgress.py
@@ -25,6 +25,7 @@ import gtk
import apt
import apt_pkg
from gettext import gettext as _
+from Common.utils import *
# intervals of the start up progress
# 3x caching and menu creation
@@ -104,12 +105,14 @@ class GtkFetchProgress(apt.progress.FetchProgress):
if currentItem > self.totalItems:
currentItem = self.totalItems
if self.currentCPS > 0:
- statusText = (_("Downloading file %li of %li with %s/s"
- % (currentItem, self.totalItems,
- apt_pkg.SizeToStr(self.currentCPS))))
+ statusText = (_("Downloading file %(current)li of %(total)li with "
+ "%(speed)s/s") % {"current" : currentItem,
+ "total" : self.totalItems,
+ "speed" : humanize_size(self.currentCPS)})
else:
- statusText = (_("Downloading file %li of %li with unknown "
- "speed") % (currentItem, self.totalItems))
+ statusText = (_("Downloading file %(current)li of %(total)li") % \
+ {"current" : currentItem,
+ "total" : self.totalItems })
self.progress.set_fraction(self.percent/100.0)
self.status.set_markup("<i>%s</i>" % statusText)
# TRANSLATORS: show the remaining time in a progress bar:
diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py
index 63d0eab9..04ad107c 100644
--- a/UpdateManager/UpdateManager.py
+++ b/UpdateManager/UpdateManager.py
@@ -237,7 +237,7 @@ class UpdateList:
("%s-updates" % dist, "Ubuntu", _("Recommended updates"), 9),
("%s-proposed" % dist, "Ubuntu", _("Proposed updates"), 8),
("%s-backports" % dist, "Ubuntu", _("Backports"), 7),
- (dist, "Ubuntu", _("Normal updates"), 6)]
+ (dist, "Ubuntu", _("Distribution updates"), 6)]
self.pkgs = {}
self.matcher = {}
@@ -576,23 +576,6 @@ class UpdateManager(SimpleGladeApp):
self.treeview_update.queue_draw()
self.setBusy(False)
- def humanize_size(self, bytes):
- """
- Convert a given size in bytes to a nicer better readable unit
- """
- if bytes == 0:
- # TRANSLATORS: download size is 0
- return _("None")
- elif bytes < 1024:
- # TRANSLATORS: download size of very small updates
- return _("1 KB")
- elif bytes < 1024 * 1024:
- # TRANSLATORS: download size of small updates, e.g. "250 KB"
- return locale.format(_("%.0f KB"), bytes/1024)
- else:
- # TRANSLATORS: download size of updates, e.g. "2.3 MB"
- return locale.format(_("%.1f MB"), bytes / 1024 / 1024)
-
def setBusy(self, flag):
""" Show a watch cursor if the app is busy for more than 0.3 sec.
Furthermore provide a loop to handle user interface events """
@@ -609,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" % \
- self.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
@@ -618,7 +601,7 @@ class UpdateManager(SimpleGladeApp):
self.refresh_updates_count()
num_updates = self.cache.installCount
if num_updates == 0:
- text_header= "<big><b>"+_("Your system is up-to-date")+"</b></big>"
+ text_header= "<big><b>%s</b></big>" %_("Your system is up-to-date")
text_download = ""
self.notebook_details.set_sensitive(False)
self.treeview_update.set_sensitive(False)
@@ -628,12 +611,12 @@ class UpdateManager(SimpleGladeApp):
self.textview_changes.get_buffer().set_text("")
self.textview_descr.get_buffer().set_text("")
else:
- text_header = "<big><b>" + \
- gettext.ngettext("You can install %s update",
- "You can install %s updates",
- num_updates) % \
- num_updates + "</b></big>"
- text_download = _("Download size: %s") % self.humanize_size(self.dl_size)
+ text_header = "<big><b>%s</b></big>" % \
+ (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)
self.button_install.grab_default()
@@ -820,16 +803,16 @@ class UpdateManager(SimpleGladeApp):
for pkg in self.list.pkgs[origin]:
name = xml.sax.saxutils.escape(pkg.name)
summary = xml.sax.saxutils.escape(pkg.summary)
- contents = "<b>%s</b>\n<small>%s\n" % (name, summary)
+ contents = "<b>%s</b>\n<small>%s</small>" % (name, summary)
if pkg.installedVersion != None:
- contents += _("From version %s to %s") % \
- (pkg.installedVersion,
- pkg.candidateVersion)
+ version = _("From version %(old_version)s to %(new_version)s") %\
+ {"old_version" : pkg.installedVersion,
+ "new_version" : pkg.candidateVersion}
else:
- contents += _("Version %s") % pkg.candidateVersion
+ version = _("Version %s") % pkg.candidateVersion
#TRANSLATORS: the b stands for Bytes
- contents += " " + _("(Size: %s)") % self.humanize_size(pkg.packageSize)
- contents += "</small>"
+ size = _("(Size: %s)") % humanize_size(pkg.packageSize)
+ contents = "%s\n<small>%s %s</small>" % (contents, version, size)
self.store.append([contents, pkg.name, pkg])
self.update_count()
diff --git a/debian/changelog b/debian/changelog
index 02ec4d9d..8bc27537 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ update-manager (0.44.15) edgy; urgency=low
* data/glade/SoftwareProperties.glade:
- fix missing "translatable" property (lp: #62681)
+ * missing i18n added (lp: 62519)
--
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