diff options
Diffstat (limited to 'sugar')
-rw-r--r-- | sugar/activity/activityfactory.py | 5 | ||||
-rw-r--r-- | sugar/activity/bundle.py | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/sugar/activity/activityfactory.py b/sugar/activity/activityfactory.py index 7d49ffb..3765f8e 100644 --- a/sugar/activity/activityfactory.py +++ b/sugar/activity/activityfactory.py @@ -70,8 +70,9 @@ class ActivityCreationHandler(gobject.GObject): registry = bundleregistry.get_registry() bundle = registry.get_bundle(service_name) - gettext.bindtextdomain(self._service_name, - os.path.join(bundle.get_path(), "locale")) + print self._service_name + print bundle.get_locale_path() + gettext.bindtextdomain(self._service_name, bundle.get_locale_path()) gettext.textdomain(self._service_name) bus = dbus.SessionBus() diff --git a/sugar/activity/bundle.py b/sugar/activity/bundle.py index 8dcd33c..3e46d10 100644 --- a/sugar/activity/bundle.py +++ b/sugar/activity/bundle.py @@ -81,7 +81,7 @@ class Bundle: path = None lang = locale.getdefaultlocale()[0] if lang != None: - path = os.path.join(self._path, 'locale', lang) + path = os.path.join(self.get_locale_path(), lang) if os.path.isdir(path): path = os.path.join(self._path, 'locale', lang[:2]) if not os.path.isdir(path): @@ -95,6 +95,10 @@ class Bundle: def is_valid(self): return self._valid + def get_locale_path(self): + """Get the locale path inside the activity bundle.""" + return os.path.join(self._path, 'locale') + def get_path(self): """Get the activity bundle path.""" return self._path |