6 language = locale.getdefaultlocale()[0]
7 mo_filename = os.path.join(
8 os.path.dirname(__file__), 'translations', language + '.mo')
9 if os.path.exists(mo_filename):
10 mo_file = open(mo_filename, 'rb')
11 translation = gettext.GNUTranslations(mo_file)
14 translation = gettext.NullTranslations()
15 translation.install(unicode=True)