Fix locale path handling
This commit is contained in:
parent
ca9199e994
commit
ba242f34b7
@ -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()
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user