5 # Change this variable to your app name!
6 # The translation files will be under
7 # @LOCALE_DIR@/@LANGUAGE@/LC_MESSAGES/@APP_NAME@.mo
9 APP_NAME = "mussorgsky"
11 # This is ok for maemo. Not sure in a regular desktop:
13 APP_DIR = os.path.join (sys.prefix,
15 LOCALE_DIR = os.path.join(APP_DIR, 'locale')
18 # Now we need to choose the language. We will provide a list, and gettext
19 # will use the first translation available in the list
21 # In maemo it is in the LANG environment variable
22 # (on desktop is usually LANGUAGES)
24 DEFAULT_LANGUAGES = os.environ.get('LANG', '').split(':')
25 DEFAULT_LANGUAGES += ['en_US']
27 # Try to get the languages from the default locale
28 lc, encoding = locale.getdefaultlocale()
32 # Concat all languages (env + default locale),
33 # and here we have the languages and location of the translations
35 languages += DEFAULT_LANGUAGES
36 mo_location = LOCALE_DIR
38 # Lets tell those details to gettext
39 # (nothing to change here for you)
40 gettext.install (True)
41 gettext.bindtextdomain (APP_NAME,
43 gettext.textdomain (APP_NAME)
44 language = gettext.translation (APP_NAME,
46 languages = languages,
49 # And now in your modules you can do:
52 # _ = i18n.language.gettext