Paste Code
Paste Blends
Paste Images
def valid_language(text):
supported_languages = ['en']
if supported_languages:
lang = langdetect.detect(text)
if lang not in supported_languages:
raise ValidationError(
'Language "{0}" is not one of the supported languages {1}!'.format(lang, supported_languages))
  1. def valid_language(text):
  2.     supported_languages = ['en']
  3.     if supported_languages:
  4.         lang = langdetect.detect(text)
  5.         if lang not in supported_languages:
  6.             raise ValidationError(
  7.                     'Language "{0}" is not one of the supported languages {1}!'.format(lang, supported_languages))
go to heaven