try:
return [dirname for dirname
in pkg_resources.resource_listdir('trac', 'locale')
if '.' not in dirname]
if '.' not in dirname
and pkg_resources.resource_exists(
'trac', 'locale/%s/LC_MESSAGES/messages.mo' % dirname)]
except Exception:
return []
-----------------------------------------------------------------------