Commits

Anonymous committed 405a9a8

trivial: Better error logging if LINGUAS is not found.

Comments (0)

Files changed (1)

transifex/txcommon/i18n.py

 def available_languages(localedir):
     """Return available languages in the LINGUAS file."""
     available_languages = []
+    linguas_file = os.path.join(localedir, 'LINGUAS')
     try:
-        linguas = codecs.open(os.path.join(localedir, 'LINGUAS'), 'r')
+        linguas = codecs.open(linguas_file, 'r')
         for lang in linguas.readlines():
             lang = lang.strip()
             if lang and not lang.startswith('#'):
                 available_languages.append((lang,lang))
     except IOError, e:
-        logging.error(_('The LINGUAS file could not be opened: %s') % e)
+        logging.error(_('The LINGUAS file (%s) could not be opened: %s') % 
+                        (linguas_file, e))
     return available_languages