@lru_cache()
def get_babel_locale(locale_string):
 return babel.Locale.parse(locale_string, '-')

@ lru_cache ( ) def get_babel_locale ( locale_string ) : return babel . Locale . parse ( locale_string , '-' )
parse a django-format locale string and return a babel locale .