Prevent blank menu caption.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1663 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
ad497bdcba
commit
937cee7269
|
@ -167,7 +167,9 @@ module Redmine
|
||||||
|
|
||||||
def caption(project=nil)
|
def caption(project=nil)
|
||||||
if @caption.is_a?(Proc)
|
if @caption.is_a?(Proc)
|
||||||
@caption.call(project)
|
c = @caption.call(project).to_s
|
||||||
|
c = @name.to_s.humanize if c.blank?
|
||||||
|
c
|
||||||
else
|
else
|
||||||
# check if localized string exists on first render (after GLoc strings are loaded)
|
# 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_key ||= (@caption || (l_has_string?("label_#{@name}".to_sym) ? "label_#{@name}".to_sym : @name.to_s.humanize))
|
||||||
|
|
Loading…
Reference in New Issue