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()
|
registry = bundleregistry.get_registry()
|
||||||
bundle = registry.get_bundle(service_name)
|
bundle = registry.get_bundle(service_name)
|
||||||
|
|
||||||
gettext.bindtextdomain(self._service_name,
|
print self._service_name
|
||||||
os.path.join(bundle.get_path(), "locale"))
|
print bundle.get_locale_path()
|
||||||
|
gettext.bindtextdomain(self._service_name, bundle.get_locale_path())
|
||||||
gettext.textdomain(self._service_name)
|
gettext.textdomain(self._service_name)
|
||||||
|
|
||||||
bus = dbus.SessionBus()
|
bus = dbus.SessionBus()
|
||||||
|
@ -81,7 +81,7 @@ class Bundle:
|
|||||||
path = None
|
path = None
|
||||||
lang = locale.getdefaultlocale()[0]
|
lang = locale.getdefaultlocale()[0]
|
||||||
if lang != None:
|
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):
|
if os.path.isdir(path):
|
||||||
path = os.path.join(self._path, 'locale', lang[:2])
|
path = os.path.join(self._path, 'locale', lang[:2])
|
||||||
if not os.path.isdir(path):
|
if not os.path.isdir(path):
|
||||||
@ -95,6 +95,10 @@ class Bundle:
|
|||||||
def is_valid(self):
|
def is_valid(self):
|
||||||
return self._valid
|
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):
|
def get_path(self):
|
||||||
"""Get the activity bundle path."""
|
"""Get the activity bundle path."""
|
||||||
return self._path
|
return self._path
|
||||||
|
Loading…
Reference in New Issue
Block a user