Skip to content

Commit

Permalink
fix issue with i18njs. try the base language if no region specific tr…
Browse files Browse the repository at this point in the history
…anslation catalog is available.
  • Loading branch information
tmog committed Oct 20, 2015
1 parent 3d64a8d commit f6850de
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plone/app/content/browser/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ class i18njs(BrowserView):
@ram.cache(_cache_key)
def _gettext_catalog(self, domain, language):
td = queryUtility(ITranslationDomain, domain)
if td is None or language not in td._catalogs:
if td is None:
return
if language not in td._catalogs:
baselanguage = language.split('-')[0]
if baselanguage not in td._catalogs:
return
else:
language = baselanguage
mo_path = td._catalogs[language][0]
catalog = td._data[mo_path]._catalog
if catalog is None:
Expand Down

0 comments on commit f6850de

Please sign in to comment.