From abe0de3ef8ebd6c29fa7704d3ded8c2fb51e910a Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Wed, 11 Sep 2013 15:07:53 +0200 Subject: [PATCH] Fix translations domains to point to new toolkit --- bin/sugar-activity | 2 +- src/sugar3/activity/activity.py | 2 +- src/sugar3/activity/widgets.py | 3 +-- src/sugar3/graphics/alert.py | 3 +-- src/sugar3/graphics/colorbutton.py | 3 +-- src/sugar3/mime.py | 2 +- src/sugar3/util.py | 10 ++++------ 7 files changed, 10 insertions(+), 15 deletions(-) diff --git a/bin/sugar-activity b/bin/sugar-activity index a8d4246f..00e9063c 100644 --- a/bin/sugar-activity +++ b/bin/sugar-activity @@ -112,7 +112,7 @@ def main(): config.locale_path) gettext.bindtextdomain(bundle.get_bundle_id(), activity_locale_path) - gettext.bindtextdomain('sugar-toolkit', config.locale_path) + gettext.bindtextdomain('sugar-toolkit-gtk3', config.locale_path) gettext.textdomain(bundle.get_bundle_id()) splitted_module = args[0].rsplit('.', 1) diff --git a/src/sugar3/activity/activity.py b/src/sugar3/activity/activity.py index 6052cdd1..6a0dbe00 100644 --- a/src/sugar3/activity/activity.py +++ b/src/sugar3/activity/activity.py @@ -83,7 +83,7 @@ from sugar3.graphics.icon import Icon from sugar3.datastore import datastore from gi.repository import SugarExt -_ = lambda msg: gettext.dgettext('sugar-toolkit', msg) +from gettext import gettext as _ SCOPE_PRIVATE = 'private' SCOPE_INVITE_ONLY = 'invite' # shouldn't be shown in UI, it's implicit diff --git a/src/sugar3/activity/widgets.py b/src/sugar3/activity/widgets.py index 1bd9d340..3cb612a6 100644 --- a/src/sugar3/activity/widgets.py +++ b/src/sugar3/activity/widgets.py @@ -32,8 +32,7 @@ from sugar3.bundle.activitybundle import ActivityBundle from sugar3.graphics import style from sugar3.graphics.palettemenu import PaletteMenuBox - -_ = lambda msg: gettext.dgettext('sugar-toolkit', msg) +from gettext import gettext as _ def _create_activity_icon(metadata): diff --git a/src/sugar3/graphics/alert.py b/src/sugar3/graphics/alert.py index d1dc79b6..3bf65ca5 100644 --- a/src/sugar3/graphics/alert.py +++ b/src/sugar3/graphics/alert.py @@ -55,8 +55,7 @@ import math from sugar3.graphics import style from sugar3.graphics.icon import Icon - -_ = lambda msg: gettext.dgettext('sugar-toolkit', msg) +from gettext import gettext as _ class Alert(Gtk.EventBox): diff --git a/src/sugar3/graphics/colorbutton.py b/src/sugar3/graphics/colorbutton.py index 1504bbd4..3291b46c 100644 --- a/src/sugar3/graphics/colorbutton.py +++ b/src/sugar3/graphics/colorbutton.py @@ -28,8 +28,7 @@ from sugar3.graphics import style from sugar3.graphics.icon import Icon from sugar3.graphics.palette import Palette, ToolInvoker, WidgetInvoker - -_ = lambda msg: gettext.dgettext('sugar-toolkit', msg) +from gettext import gettext as _ def get_svg_color_string(color): diff --git a/src/sugar3/mime.py b/src/sugar3/mime.py index d5ffbd4c..4f4103a4 100644 --- a/src/sugar3/mime.py +++ b/src/sugar3/mime.py @@ -31,7 +31,7 @@ from gi.repository import Gio from gi.repository import SugarExt -_ = lambda msg: gettext.dgettext('sugar-base', msg) +from gettext import gettext as _ GENERIC_TYPE_TEXT = 'Text' GENERIC_TYPE_IMAGE = 'Image' diff --git a/src/sugar3/util.py b/src/sugar3/util.py index 4a36e048..6ba23a81 100644 --- a/src/sugar3/util.py +++ b/src/sugar3/util.py @@ -30,8 +30,7 @@ import tempfile import logging import atexit - -_ = lambda msg: gettext.dgettext('sugar-toolkit', msg) +from gettext import gettext as _ def printable_hash(in_hash): @@ -270,10 +269,9 @@ def timestamp_to_elapsed_string(timestamp, max_levels=2): if key in _i18n_timestamps_cache: time_period += _i18n_timestamps_cache[key] else: - tmp = gettext.dngettext('sugar-toolkit', - name_singular, - name_plural, - elapsed_units) + tmp = gettext.ngettext(name_singular, + name_plural, + elapsed_units) # FIXME: This is a hack so we don't crash when a translation # doesn't contain the expected number of placeholders (#2354) try: