6 language = locale.getdefaultlocale()[0]
10 mo_filename = os.path.join(
11 os.path.dirname(__file__), 'translations', language + '.mo')
12 if os.path.exists(mo_filename):
13 mo_file = open(mo_filename, 'rb')
14 translations = gettext.GNUTranslations(mo_file)
17 if translations is None:
18 translations = gettext.NullTranslations()