Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def timeago_template(locale, index, ago_in):
'''
simple locale implement
'''
try:
LOCALE = __import__('timeago.locales.' + locale)
LOCALE = locale_module(LOCALE, locale)
except:
locale = setting.DEFAULT_LOCALE
LOCALE = __import__('timeago.locales.' + locale)
LOCALE = locale_module(LOCALE, locale)
if isinstance(LOCALE, list):
return LOCALE[index][ago_in]
else:
return LOCALE(index, ago_in)