setLanguageForm = (req, user) =>
  form(
    {
      action: `/auth/setlanguage/`,
      method: "post",
    },
    csrfField(req.csrfToken()),
    select(
      { name: "locale", onchange: "form.submit()" },
      Object.entries(available_languages).map(([locale, language]) =>
        option(
          {
            value: locale,
            ...(((user && user.language === locale) ||
              (user && !user.language && req.getLocale() === locale)) && {
              selected: true,
            }),
          },
          language
        )
      )
    )
  )
@param {object} req
@param {object} user
@returns {Form}