@api_view(['GET'])
def locales_api_view(request):
 locales = {}
 for lang in settings.SUMO_LANGUAGES:
  if (lang == 'xx'):
   continue
  locale = {'name': LOCALES[lang].english, 'localized_name': LOCALES[lang].native, 'aaq_enabled': QuestionLocale.objects.filter(locale=lang).exists()}
  locales[lang] = locale
 return Response(locales)

@ api_view ( [ 'GET' ] ) def locales_api_view ( request ) : locales = { } for lang in settings . SUMO_LANGUAGES : if ( lang == 'xx' ) : continue locale = { 'name' : LOCALES [ lang ] . english , 'localized_name' : LOCALES [ lang ] . native , 'aaq_enabled' : QuestionLocale . objects . filter ( locale = lang ) . exists ( ) } locales [ lang ] = locale return Response ( locales )
api endpoint listing all supported locales .