summaryrefslogtreecommitdiff
path: root/addons/web/controllers
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2012-11-29 15:01:09 +0100
committerXavier Morel <xmo@openerp.com>2012-11-29 15:01:09 +0100
commit0b0cfff0630f1453c32fad56f19928fa335bf764 (patch)
tree5af1ecfba62fe484dc2df8076f7445bbe03a3e00 /addons/web/controllers
parent184593003b3aec7d40660ae13002f4a4a205fa12 (diff)
parent83b7823f257b17403a11908c9b359244635cf0b7 (diff)
[MERGE] missing translation marks, courtesy of Csaba TOTH
lp bug: https://launchpad.net/bugs/1084306 fixed bzr revid: xmo@openerp.com-20121129140109-bwx1njhyqfenc2d3
Diffstat (limited to 'addons/web/controllers')
-rw-r--r--addons/web/controllers/main.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py
index 02fee425aba..3f35b3f44ea 100644
--- a/addons/web/controllers/main.py
+++ b/addons/web/controllers/main.py
@@ -28,6 +28,7 @@ except ImportError:
xlwt = None
import openerp
+from openerp.tools.translate import _
from .. import http
openerpweb = http
@@ -762,7 +763,7 @@ class Database(openerpweb.Controller):
except xmlrpclib.Fault, e:
if e.faultCode and e.faultCode.split(':')[0] == 'AccessDenied':
return {'error': e.faultCode, 'title': 'Drop Database'}
- return {'error': 'Could not drop database !', 'title': 'Drop Database'}
+ return {'error': _('Could not drop database !'), 'title': _('Drop Database')}
@openerpweb.httprequest
def backup(self, req, backup_db, backup_pwd, token):
@@ -780,7 +781,7 @@ class Database(openerpweb.Controller):
{'fileToken': int(token)}
)
except xmlrpclib.Fault, e:
- return simplejson.dumps([[],[{'error': e.faultCode, 'title': 'backup Database'}]])
+ return simplejson.dumps([[],[{'error': e.faultCode, 'title': _('Backup Database')}]])
@openerpweb.httprequest
def restore(self, req, db_file, restore_pwd, new_db):
@@ -801,8 +802,8 @@ class Database(openerpweb.Controller):
return req.session.proxy("db").change_admin_password(old_password, new_password)
except xmlrpclib.Fault, e:
if e.faultCode and e.faultCode.split(':')[0] == 'AccessDenied':
- return {'error': e.faultCode, 'title': 'Change Password'}
- return {'error': 'Error, password not changed !', 'title': 'Change Password'}
+ return {'error': e.faultCode, 'title': _('Change Password')}
+ return {'error': _('Error, password not changed !'), 'title': _('Change Password')}
class Session(openerpweb.Controller):
_cp_path = "/web/session"
@@ -838,16 +839,16 @@ class Session(openerpweb.Controller):
old_password, new_password,confirm_password = operator.itemgetter('old_pwd', 'new_password','confirm_pwd')(
dict(map(operator.itemgetter('name', 'value'), fields)))
if not (old_password.strip() and new_password.strip() and confirm_password.strip()):
- return {'error':'You cannot leave any password empty.','title': 'Change Password'}
+ return {'error':_('You cannot leave any password empty.'),'title': _('Change Password')}
if new_password != confirm_password:
- return {'error': 'The new password and its confirmation must be identical.','title': 'Change Password'}
+ return {'error': _('The new password and its confirmation must be identical.'),'title': _('Change Password')}
try:
if req.session.model('res.users').change_password(
old_password, new_password):
return {'new_password':new_password}
except Exception:
- return {'error': 'The old password you provided is incorrect, your password was not changed.', 'title': 'Change Password'}
- return {'error': 'Error, password not changed !', 'title': 'Change Password'}
+ return {'error': _('The old password you provided is incorrect, your password was not changed.'), 'title': _('Change Password')}
+ return {'error': _('Error, password not changed !'), 'title': _('Change Password')}
@openerpweb.jsonrequest
def sc_list(self, req):
@@ -859,7 +860,7 @@ class Session(openerpweb.Controller):
try:
return req.session.proxy("db").list_lang() or []
except Exception, e:
- return {"error": e, "title": "Languages"}
+ return {"error": e, "title": _("Languages")}
@openerpweb.jsonrequest
def modules(self, req):
@@ -1302,7 +1303,7 @@ class Binary(openerpweb.Controller):
res = Model.default_get(fields, context)
filecontent = base64.b64decode(res.get(field, ''))
if not filecontent:
- raise ValueError("No content found for field '%s' on '%s:%s'" %
+ raise ValueError(_("No content found for field '%s' on '%s:%s'") %
(field, model, id))
else:
filename = '%s_%s' % (model.replace('.', '_'), id)