Move the translation initialisation to an earlier stage, SL #3654

Must be done early, some activities set translations globally. Remove
the support for the langpackdir.

Signed-off-by: Simon Schampijer <simon@laptop.org>
This commit is contained in:
Simon Schampijer
2012-06-04 17:45:30 +02:00
parent cd9a2b4501
commit 6330204e91
3 changed files with 9 additions and 16 deletions
+8
View File
@@ -26,6 +26,8 @@ import dbus.service
import dbus.glib
from sugar3.activity import activityhandle
from sugar3.activity import i18n
import sugar3
from sugar3.bundle.activitybundle import ActivityBundle
from sugar3 import logger
@@ -97,6 +99,12 @@ def main():
os.environ['SUGAR_BUNDLE_NAME'] = bundle.get_name()
os.environ['SUGAR_BUNDLE_VERSION'] = str(bundle.get_activity_version())
# 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())
splitted_module = args[0].rsplit('.', 1)
module_name = splitted_module[0]
class_name = splitted_module[1]