diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2011-09-03 11:44:34 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2011-09-03 11:44:47 +0100 |
commit | 204e5c3a739a2bedf927b2f6aa82c373731bbda8 (patch) | |
tree | 669931c42034d41329418f1ead3dc8ad6bcf9881 /app/models/user.rb | |
parent | a79be3df0fddf2763376033cf731f0efbc915fcf (diff) |
Store user's locale against profile, so we can send them localised track emails. Also internationalize more strings at the same time. Fixes #163.
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index fddb6b035..c3c3da6f7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -96,6 +96,15 @@ class User < ActiveRecord::Base end end end + + def get_locale + if !self.locale.nil? + locale = self.locale + else + locale = I18n.locale + end + return locale.to_s + end def visible_comments self.comments.find(:all, :conditions => 'visible') |