From b8ae254856d9884b3765361a82c300fd9117af0f Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Mon, 03 Aug 2009 16:44:36 +0000 Subject: Cleanup gettext stuff --- 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): -- cgit v0.9.1