Commit ba3f46fb authored by ibuler's avatar ibuler

i18n

parent 0b406b69
......@@ -80,6 +80,7 @@ MIDDLEWARE = [
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.locale.LocaleMiddleware',
]
ROOT_URLCONF = 'jumpserver.urls'
......@@ -307,3 +308,5 @@ CELERY_RESULT_BACKEND = BROKER_URL
# Captcha settings, more see https://django-simple-captcha.readthedocs.io/en/latest/advanced.html
CAPTCHA_IMAGE_SIZE = (75, 33)
CAPTCHA_FOREGROUND_COLOR = '#001100'
#
......@@ -7,6 +7,7 @@ import logging
from django.shortcuts import get_object_or_404, reverse, render, Http404, redirect
from django.http import HttpResponseRedirect
from django.urls import reverse_lazy
from django.utils.translation import ugettext as _
from django.db.models import Q
from django.views.generic.base import View, TemplateView
from django.views.generic.list import ListView
......@@ -50,7 +51,7 @@ class UserLoginView(FormView):
user = authenticate(username=username, password=password)
if user is None:
kwargs.update({'errors': '账号密码不正确'})
kwargs.update({'errors': _('Username or password invalid')})
return self.get(request, *args, **kwargs)
login(request, user)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment