Merge lp:~savoirfairelinux-openerp/ocb-web/translate_warnings_1297525 into lp:ocb-web

Status: Rejected
Rejected by: Holger Brunn (Therp) on 2014-11-24
Proposed branch: lp:~savoirfairelinux-openerp/ocb-web/translate_warnings_1297525
Merge into: lp:ocb-web
Diff against target: 33 lines (+5/-4)
1 file modified
addons/web/session.py (+5/-4)
To merge this branch: bzr merge lp:~savoirfairelinux-openerp/ocb-web/translate_warnings_1297525
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) 2014-03-25 Disapprove on 2014-11-24
Stefan Rijnhart (Opener) 2014-04-30 Pending
OpenERP Community Reviewer/Maintainer 2014-04-30 Pending
Review via email: mp+212739@code.launchpad.net

Description of the change

Allows the title of warning boxes such as except_orm to be translated.

Prerequisite for displaying translated values:
https://code.launchpad.net/~savoirfairelinux-openerp/ocb-server/translate_warnings_1297525-trunk/+merge/212736

To post a comment you must log in.
review: Approve (code review)
4173. By Sandy Carter (http://www.savoirfairelinux.com) on 2014-04-30

[IMP] Use english translatable string in error popups

Holger Brunn (Therp) (hbrunn) wrote :

please make a pull request for https://github.com/OCA/OCB if you still consider this fix relevant.

Holger Brunn (Therp) (hbrunn) wrote :

Development for 7.0 has moved to github on https://github.com/OCA/ocb - please move your merge proposal there if it is still valid.

(I close and reject this in order to have a cleaner overview for 6.1 MPs which indeed have to be done on launchpad)

review: Disapprove

Unmerged revisions

4173. By Sandy Carter (http://www.savoirfairelinux.com) on 2014-04-30

[IMP] Use english translatable string in error popups

4172. By Sandy Carter (http://www.savoirfairelinux.com) on 2014-03-25

Made Error messages translatable

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/session.py'
2--- addons/web/session.py 2013-05-14 10:37:36 +0000
3+++ addons/web/session.py 2014-04-30 15:36:22 +0000
4@@ -8,6 +8,7 @@
5 import xmlrpclib
6
7 import openerp
8+from openerp.tools.translate import _
9
10 _logger = logging.getLogger(__name__)
11
12@@ -84,17 +85,17 @@
13 self.jsonp_requests = {} # FIXME use a LRU
14
15 def send(self, service_name, method, *args):
16- code_string = u"warning -- %s\n\n%s"
17+ code_string = _(u"warning -- %s\n\n%s")
18 try:
19 return openerp.netsvc.dispatch_rpc(service_name, method, args)
20 except openerp.osv.osv.except_osv, e:
21 raise xmlrpclib.Fault(code_string % (e.name, e.value), '')
22 except openerp.exceptions.Warning, e:
23- raise xmlrpclib.Fault(code_string % ("Warning", e), '')
24+ raise xmlrpclib.Fault(code_string % (_("Warning"), e), '')
25 except openerp.exceptions.AccessError, e:
26- raise xmlrpclib.Fault(code_string % ("AccessError", e), '')
27+ raise xmlrpclib.Fault(code_string % (_("Access Error"), e), '')
28 except openerp.exceptions.AccessDenied, e:
29- raise xmlrpclib.Fault('AccessDenied', openerp.tools.ustr(e))
30+ raise xmlrpclib.Fault(_('Access Denied'), openerp.tools.ustr(e))
31 except openerp.exceptions.DeferredException, e:
32 formatted_info = "".join(traceback.format_exception(*e.traceback))
33 raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)