def is_tester(self):
return self.state == "tester"
+ def get_locale(self):
+ return tornado.locale.get(self.data.locale)
+
def set_locale(self, locale):
self._set_attribute("locale", locale)
- locale = property(lambda s: s.data.locale, set_locale)
+ locale = property(get_locale, set_locale)
def get_timezone(self, tz=None):
if tz is None:
logging.debug("Sending email address activation mail to %s" % self.email)
# Get the saved locale from the user.
- _ = tornado.locale.get(self.user.locale).translate
+ _ = self.user.locale.translate
subject = _("Email address Activation")
return self.session.impersonated_user or self.session.user
def get_user_locale(self):
- # Get the locale from the user settings.
- if self.current_user and self.current_user.locale:
- locale = tornado.locale.get(self.current_user.locale)
- if locale:
- return locale
+ # Get the locale from the user settings
+ if self.current_user:
+ return self.current_user.locale
- # If no locale was provided, we take what ever the browser requested.
+ # If no locale was provided, we take what ever the browser requested
return self.get_browser_locale()
@property