summaryrefslogtreecommitdiffstats
path: root/lib/redmine/menu_manager.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/redmine/menu_manager.rb')
-rw-r--r--lib/redmine/menu_manager.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/redmine/menu_manager.rb b/lib/redmine/menu_manager.rb
index 7a89a32b9..353a1f3a8 100644
--- a/lib/redmine/menu_manager.rb
+++ b/lib/redmine/menu_manager.rb
@@ -15,8 +15,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-require 'gloc'
-
module Redmine
module MenuManager
module MenuController
@@ -101,7 +99,7 @@ module Redmine
item.url
end
caption = item.caption(project)
- caption = l(caption) if caption.is_a?(Symbol)
+ caption = l_or_humanize(caption, :prefix => 'label_') if caption.is_a?(Symbol)
if block_given?
yield item, caption, url, (current_menu_item == item.name)
else
@@ -178,7 +176,7 @@ module Redmine
end
class MenuItem
- include GLoc
+ include Redmine::I18n
attr_reader :name, :url, :param, :condition
def initialize(name, url, options)
@@ -188,7 +186,7 @@ module Redmine
@url = url
@condition = options[:if]
@param = options[:param] || :id
- @caption = options[:caption]
+ @caption = options[:caption] || @name
@html_options = options[:html] || {}
# Adds a unique class to each menu item based on its name
@html_options[:class] = [@html_options[:class], @name.to_s.dasherize].compact.join(' ')
@@ -200,8 +198,7 @@ module Redmine
c = @name.to_s.humanize if c.blank?
c
else
- # check if localized string exists on first render (after GLoc strings are loaded)
- @caption_key ||= (@caption || (l_has_string?("label_#{@name}".to_sym) ? "label_#{@name}".to_sym : @name.to_s.humanize))
+ @caption
end
end