load translations from local directory if not found globaly

This commit is contained in:
Benjamin Dauvergne 2014-01-08 23:37:59 +01:00
parent 28626d887b
commit 12b908310a
1 changed files with 4 additions and 1 deletions

View File

@ -552,7 +552,10 @@ class QommonPublisher(Publisher):
try:
cls.translations[lang] = gettext.translation(cls.APP_NAME, languages=[lang])
except IOError:
pass
print lang, 'not found'
path = os.path.join('po', lang + '.mo')
cls.translations[lang] = gettext.GNUTranslations(file(path))
print cls.translations[lang].gettext('Log in')
if cls.translation_domains:
for domain in cls.translation_domains: