checkLanguage(req, language) {
    if (language) {
      try {
        languages.validate(language);
      } catch (error) {
        req.flashError(error);
      }
    }
  }
// add an error to the flash
add an error to the flash
add an error to the flash
checkLanguage(req, language) {
    if (language) {
      try {
        languages.validate(language);
      } catch (error) {
        req.flashError(error);
      }
    }
  }
checkLanguage ( req , language ) { if ( language ) { try { languages . validate ( language ) ; } catch ( error ) { req . flashError ( error ) ; } } }
add an error to the flash
add an error to the flash