Mercurial > p > roundup > code
changeset 2561:0dd3dca6bd01
always use translation service set in the tracker client instance;
add vim modeline
| author | Alexander Smishlajev <a1s@users.sourceforge.net> |
|---|---|
| date | Mon, 12 Jul 2004 09:18:08 +0000 |
| parents | d45f1669599c |
| children | 1f4791438b65 |
| files | roundup/cgi/templating.py |
| diffstat | 1 files changed, 9 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/roundup/cgi/templating.py Mon Jul 12 09:14:12 2004 +0000 +++ b/roundup/cgi/templating.py Mon Jul 12 09:18:08 2004 +0000 @@ -62,7 +62,7 @@ if translator: self._ = translator.gettext else: - self._ = translationService.gettext + self._ = TranslationService.get_translation().gettext def __str__(self): return self._('You are not allowed to %(action)s ' 'items of class %(class)s') % { @@ -406,14 +406,16 @@ view this class. ''' if not self.is_view_ok(): - raise Unauthorised("view", self._classname) + raise Unauthorised("view", self._classname, + translator=self._client.translator) def edit_check(self): ''' Raise the Unauthorised exception if the user's not permitted to edit this class. ''' if not self.is_edit_ok(): - raise Unauthorised("edit", self._classname) + raise Unauthorised("edit", self._classname, + translator=self._client.translator) def input_html4(**attrs): """Generate an 'input' (html4) element with given attributes""" @@ -441,7 +443,7 @@ """Return the localized translation of msgid""" if self._context is None: self._context = context(self._client) - return translationService.translate(domain="roundup", + return self._client.translator.translate(domain="roundup", msgid=msgid, context=self._context) _ = gettext @@ -1355,7 +1357,7 @@ HTMLProperty.__init__(self, client, classname, nodeid, prop, name, value, anonymous=anonymous) if self._value: - self._value.setTranslator(translationService) + self._value.setTranslator(self._client.translator) self._offset = offset def plain(self): @@ -1477,7 +1479,7 @@ HTMLProperty.__init__(self, client, classname, nodeid, prop, name, value, anonymous) if self._value: - self._value.setTranslator(translationService) + self._value.setTranslator(self._client.translator) def plain(self): ''' Render a "plain" representation of the property @@ -2253,3 +2255,4 @@ '''HTML-quote the supplied text.''' return cgi.escape(url) +# vim: set et sts=4 sw=4 :
