Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/activity
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2007-03-23 16:43:40 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-03-23 16:43:40 (GMT)
commitba242f34b7554afeec5be6385d1737e5aa2b04a6 (patch)
treee273a658e0c1d133c7269d0ef26817d915c6be1d /sugar/activity
parentca9199e994016d713a2d112479c285a6ffd4a6da (diff)
Fix locale path handling
Diffstat (limited to 'sugar/activity')
-rw-r--r--sugar/activity/activityfactory.py5
-rw-r--r--sugar/activity/bundle.py6
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