File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -87,12 +87,17 @@ class NoTemplate(Exception):
8787 pass
8888
8989class Unauthorised (Exception ):
90- def __init__ (self , action , klass ):
90+ def __init__ (self , action , klass , translator = None ):
9191 self .action = action
9292 self .klass = klass
93+ if translator :
94+ self ._ = translator .gettext
95+ else :
96+ self ._ = translationService .gettext
9397 def __str__ (self ):
94- return 'You are not allowed to %s items of class %s' % (self .action ,
95- self .klass )
98+ return self ._ ('You are not allowed to %(action)s '
99+ 'items of class %(class)s' ) % {
100+ 'action' : self .action , 'class' : self .klass }
96101
97102def find_template (dir , name , extension ):
98103 ''' Find a template in the nominated dir
@@ -681,7 +686,7 @@ def submit(self, label=''"Submit New Entry"):
681686
682687 def history (self ):
683688 self .view_check ()
684- return 'New node - no history'
689+ return self . _ ( 'New node - no history' )
685690
686691 def renderWith (self , name , ** kwargs ):
687692 ''' Render this class with the given template.
You can’t perform that action at this time.
0 commit comments