summaryrefslogtreecommitdiff
path: root/Mailman/Cgi/Auth.py
diff options
context:
space:
mode:
authorbwarsaw2001-02-28 16:21:37 +0000
committerbwarsaw2001-02-28 16:21:37 +0000
commit6b0b92ba1b12cbac6eaa3ec633feaad143b18355 (patch)
treea3543cc82f62c6e8f0894729f9527eeaea64328b /Mailman/Cgi/Auth.py
parent45e4f2303dec3338f6d518260401b0da96a3e524 (diff)
downloadmailman-6b0b92ba1b12cbac6eaa3ec633feaad143b18355.tar.gz
mailman-6b0b92ba1b12cbac6eaa3ec633feaad143b18355.tar.zst
mailman-6b0b92ba1b12cbac6eaa3ec633feaad143b18355.zip
More i18n changes.
loginpage(): Be sure to set the proper charset on the Content-Type: header (using the charset for the list's preferred language). Fix Utils.maketext(). authenticate(): Mark more strings as translatable.
Diffstat (limited to 'Mailman/Cgi/Auth.py')
-rw-r--r--Mailman/Cgi/Auth.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/Mailman/Cgi/Auth.py b/Mailman/Cgi/Auth.py
index bf356d1c4..c216d22f4 100644
--- a/Mailman/Cgi/Auth.py
+++ b/Mailman/Cgi/Auth.py
@@ -20,6 +20,7 @@
from Mailman import Utils
from Mailman import Errors
from Mailman.htmlformat import FontAttr
+from Mailman.i18n import _
@@ -39,14 +40,16 @@ def loginpage(mlist, scriptname, msg='', frontpage=None):
actionurl = Utils.GetRequestURI(url)
if msg:
msg = FontAttr(msg, color='#ff0000', size='+1').Format()
- print 'Content-type: text/html\n'
+ # Language stuff
+ charset = Utils.GetCharSet(mlist.preferred_language)
+ print 'Content-type: text/html; charset=' + charset + '\n\n'
print Utils.maketext(
# Should really be admlogin.html :/
'admlogin.txt',
{'listname': mlist.real_name,
'path' : actionurl,
'message' : msg,
- })
+ }, lang=mlist.preferred_language)
@@ -71,11 +74,11 @@ def authenticate(mlist, cgidata):
try:
isauthed = mlist.WebAuthenticate(password=adminpw, cookie='admin')
except Errors.MMExpiredCookieError:
- msg = 'Stale cookie found'
+ msg = _('Stale cookie found')
except Errors.MMInvalidCookieError:
- msg = 'Error decoding authorization cookie'
+ msg = _('Error decoding authorization cookie')
except (Errors.MMBadPasswordError, Errors.MMAuthenticationError):
- msg = 'Authentication failed'
+ msg = _('Authentication failed')
#
# Returns successfully if logged in
if not isauthed: