Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-08-03 16:44:36 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2009-08-03 16:44:36 (GMT)
commitb8ae254856d9884b3765361a82c300fd9117af0f (patch)
tree6fc40f995bc9aa89e8d39b5fd3dd116972e41f8e /extensions
parente4a5bab39bdb3358a8d609ccee8de44d7b3ee857 (diff)
Cleanup gettext stuff
Diffstat (limited to 'extensions')
-rwxr-xr-xextensions/cpsection/updater/model.py26
-rw-r--r--extensions/cpsection/updater/view.py5
2 files changed, 10 insertions, 21 deletions
diff --git a/extensions/cpsection/updater/model.py b/extensions/cpsection/updater/model.py
index bb63134..97c0024 100755
--- a/extensions/cpsection/updater/model.py
+++ b/extensions/cpsection/updater/model.py
@@ -29,23 +29,15 @@ import tempfile
import locale
import logging
import urllib
-
-import gettext
-_ = lambda msg: gettext.dgettext('sugar-update-control', msg)
-
import gtk
import gobject
+from gettext import gettext as _
from jarabe.model import bundleregistry
from sugar.bundle.activitybundle import ActivityBundle
from sugar.datastore import datastore
from backends import aslo
-#_logger = logging.getLogger('update-activity')
-
-##########################################################################
-# Fundamental data object.
-
"""List of columns in the `UpdateList`."""
BUNDLE_ID, \
BUNDLE, \
@@ -241,17 +233,17 @@ 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")
+ # TRANS: download size is 0
+ return _('None')
elif bytes_ < 1024:
- # TRANSLATORS: download size of very small updates
- return _("1 KB")
+ # TRANS: 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)
+ # TRANS: 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)
+ # TRANS: download size of updates, e.g. '2.3 MB'
+ return locale.format(_('%.1f MB'), bytes_ / 1024 / 1024)
def print_available(ul):#FIXME this should onlu return available updates
def opt(x):
diff --git a/extensions/cpsection/updater/view.py b/extensions/cpsection/updater/view.py
index 0e32d51..a62fd53 100644
--- a/extensions/cpsection/updater/view.py
+++ b/extensions/cpsection/updater/view.py
@@ -23,12 +23,9 @@ from sugar.graphics import style
from jarabe.controlpanel.sectionview import SectionView
import model
-from model import _humanize_size
gtk.gdk.threads_init()
-_logger = logging.getLogger('update-activity')
-
_e = gobject.markup_escape_text
_DEBUG_VIEW_ALL = True
@@ -176,7 +173,7 @@ class BundlePane(gtk.VBox):
bundle_list = self.updater_activity.bundle_list
size = bundle_list.updates_size()
self.size_label.set_markup(_('Download size: %s') %
- _humanize_size(size))
+ model._humanize_size(size))
self.install_button.set_sensitive(bundle_list.updates_selected()!=0)
def switch(self):