summaryrefslogtreecommitdiffstats
path: root/app/models/role.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-04-05 22:37:45 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-04-05 22:37:45 +0000
commit44214ed1aad333652a092a1f7d7ed71faf0b17b6 (patch)
tree4435d447327dec45cd1ecb3a3a7df8f2c74332d6 /app/models/role.rb
parent5823481d6ef074904c495bb25ee76c86b1972d4e (diff)
downloadredmine-44214ed1aad333652a092a1f7d7ed71faf0b17b6.tar.gz
redmine-44214ed1aad333652a092a1f7d7ed71faf0b17b6.zip
Localize anonymous and non member roles names (#8072).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5333 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/role.rb')
-rw-r--r--app/models/role.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/models/role.rb b/app/models/role.rb
index 6a4b9e4e3..e0b18434e 100644
--- a/app/models/role.rb
+++ b/app/models/role.rb
@@ -1,5 +1,5 @@
-# redMine - project management software
-# Copyright (C) 2006 Jean-Philippe Lang
+# Redmine - project management software
+# Copyright (C) 2006-2011 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -84,6 +84,14 @@ class Role < ActiveRecord::Base
name
end
+ def name
+ case builtin
+ when 1; l(:label_role_non_member, :default => read_attribute(:name))
+ when 2; l(:label_role_anonymous, :default => read_attribute(:name))
+ else; read_attribute(:name)
+ end
+ end
+
# Return true if the role is a builtin role
def builtin?
self.builtin != 0