diff options
author | Simon Schampijer <simon@laptop.org> | 2013-03-05 13:17:36 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@laptop.org> | 2013-03-08 09:29:17 (GMT) |
commit | dcbdcd77fe803ca12d5b973ea3764d2042a9a991 (patch) | |
tree | 8edb9a4ab01738e8904d24d0252ff5ee47ce9b05 /bin | |
parent | 63b8e87b1a99a854e9adbb1579b1e05244d2dc46 (diff) |
i18n get_locale_path: handle the case when the default locale is not set, SL #4450
If the default locale is not set (see SL #4450 for a use case), get_locale_path
does now return None so that the sugar-activity script can handle that case
cleanly.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Reviewed-by: Daniel Drake <dsd@laptop.org>
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sugar-activity | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/sugar-activity b/bin/sugar-activity index abaa091..7cec4c4 100644 --- a/bin/sugar-activity +++ b/bin/sugar-activity @@ -107,9 +107,10 @@ def main(): # must be done early, some activities set translations globally, SL #3654 locale_path = i18n.get_locale_path(bundle.get_bundle_id()) - gettext.bindtextdomain(bundle.get_bundle_id(), locale_path) - gettext.bindtextdomain('sugar-toolkit', sugar3.locale_path) - gettext.textdomain(bundle.get_bundle_id()) + if locale_path: + gettext.bindtextdomain(bundle.get_bundle_id(), locale_path) + gettext.bindtextdomain('sugar-toolkit', sugar3.locale_path) + gettext.textdomain(bundle.get_bundle_id()) splitted_module = args[0].rsplit('.', 1) module_name = splitted_module[0] |