summaryrefslogtreecommitdiff
path: root/index.py
diff options
context:
space:
mode:
authorequinox <equinox@diac24.net>2011-09-27 10:22:11 +0200
committerequinox <equinox@diac24.net>2011-09-27 10:22:11 +0200
commit9b85f11e1d9f181679c2cf9ce86d008d6e875888 (patch)
treef83db671a30e663510634c77540a483cbf298705 /index.py
parentff31e814bdc78d57e18a66020508d7e703acf8f5 (diff)
more i18n
Diffstat (limited to 'index.py')
-rwxr-xr-xindex.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/index.py b/index.py
index cc36806..27c1a08 100755
--- a/index.py
+++ b/index.py
@@ -7,7 +7,7 @@ sys.path.append(appbase)
import threading
import cherrypy
-from tmpl import expose, render
+from tmpl import expose, render, _
from lxml import etree
from lxml.html import formfill
from StringIO import StringIO
@@ -61,9 +61,9 @@ class SubdapSite(object):
l.start_tls_s()
l.simple_bind_s(dn, password)
except ldap.INVALID_CREDENTIALS:
- raise LoginError('Login incorrect')
+ raise LoginError(_('Login incorrect'))
except ldap.LDAPError, e:
- raise LoginError('Login incorrect')
+ raise LoginError(_('Login incorrect'))
# e.message['info']
return (l, dn)
@@ -73,9 +73,9 @@ class SubdapSite(object):
return render(errors = {})
if username == None or password == None:
- return render(errors = {'password': 'Login incorrect'})
+ return render(errors = {'password': _('Login incorrect')})
if username == '' or password == '':
- return render(errors = {'password': 'Login incorrect'})
+ return render(errors = {'password': _('Login incorrect')})
try: l, dn = s.login_perform(username, password)
except LoginError, e:
@@ -105,13 +105,13 @@ class SubdapSite(object):
def newpass_validate(s, username, password, password2, expectstate):
errors = {}
if username == None or username == '':
- errors['username'] = 'please specify an user name'
+ errors['username'] = _('please specify an user name')
elif accountservice.name_valid(username) != expectstate:
- errors['username'] = 'username invalid'
+ errors['username'] = _('username invalid')
if password == None or len(password) < 6:
- errors['password'] = 'please specify a password of at least 6 characters'
+ errors['password'] = _('please specify a password of at least 6 characters')
if password2 != password:
- errors['password2'] = 'passwords did not match'
+ errors['password2'] = _('passwords did not match')
if len(errors) > 0:
return errors
return None