mirror of https://github.com/django/django.git
Added translation strings to django/contrib/admin/views/decorators.py. Taken from new-admin
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1418 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
473eabc447
commit
baba996254
|
@ -19,7 +19,7 @@ def _display_login_form(request, error_message=''):
|
||||||
else:
|
else:
|
||||||
post_data = _encode_post_data({})
|
post_data = _encode_post_data({})
|
||||||
return render_to_response('admin/login', {
|
return render_to_response('admin/login', {
|
||||||
'title': 'Log in',
|
'title': _('Log in'),
|
||||||
'app_path': request.path,
|
'app_path': request.path,
|
||||||
'post_data': post_data,
|
'post_data': post_data,
|
||||||
'error_message': error_message
|
'error_message': error_message
|
||||||
|
@ -53,15 +53,14 @@ def staff_member_required(view_func):
|
||||||
# If this isn't already the login page, display it.
|
# If this isn't already the login page, display it.
|
||||||
if not request.POST.has_key(LOGIN_FORM_KEY):
|
if not request.POST.has_key(LOGIN_FORM_KEY):
|
||||||
if request.POST:
|
if request.POST:
|
||||||
message = "Please log in again, because your session has expired. "\
|
message = _("Please log in again, because your session has expired. Don't worry: Your submission has been saved.")
|
||||||
"Don't worry: Your submission has been saved."
|
|
||||||
else:
|
else:
|
||||||
message = ""
|
message = ""
|
||||||
return _display_login_form(request, message)
|
return _display_login_form(request, message)
|
||||||
|
|
||||||
# Check that the user accepts cookies.
|
# Check that the user accepts cookies.
|
||||||
if not request.session.test_cookie_worked():
|
if not request.session.test_cookie_worked():
|
||||||
message = "Looks like your browser isn't configured to accept cookies. Please enable cookies, reload this page, and try again."
|
message = _("Looks like your browser isn't configured to accept cookies. Please enable cookies, reload this page, and try again.")
|
||||||
return _display_login_form(request, message)
|
return _display_login_form(request, message)
|
||||||
|
|
||||||
# Check the password.
|
# Check the password.
|
||||||
|
@ -75,9 +74,9 @@ def staff_member_required(view_func):
|
||||||
try:
|
try:
|
||||||
user = users.get_object(email__exact=username)
|
user = users.get_object(email__exact=username)
|
||||||
except users.UserDoesNotExist:
|
except users.UserDoesNotExist:
|
||||||
message = "Usernames cannot contain the '@' character."
|
message = _("Usernames cannot contain the '@' character.")
|
||||||
else:
|
else:
|
||||||
message = "Your e-mail address is not your username. Try '%s' instead." % user.username
|
message = _("Your e-mail address is not your username. Try '%s' instead.") % user.username
|
||||||
return _display_login_form(request, message)
|
return _display_login_form(request, message)
|
||||||
|
|
||||||
# The user data is correct; log in the user in and continue.
|
# The user data is correct; log in the user in and continue.
|
||||||
|
|
Loading…
Reference in New Issue