First take localized text into account before the title property when working with tree headers

This commit is contained in:
Tim Geyssens
2016-11-11 11:45:25 +01:00
parent df59596775
commit 7aeea96e23
+6 -4
View File
@@ -43,16 +43,18 @@ namespace Umbraco.Web.Trees
get
{
//if title is defined, return that
if(string.IsNullOrEmpty(_attribute.Title) == false)
return _attribute.Title;
//try to look up a tree header matching the tree alias
var localizedLabel = Services.TextService.Localize("treeHeaders/" + _attribute.Alias);
if (string.IsNullOrEmpty(localizedLabel) == false)
if (!string.IsNullOrEmpty(localizedLabel))
return localizedLabel;
//if title is defined, return that
if (!string.IsNullOrEmpty(_attribute.Title))
return _attribute.Title;
//is returned to signal that a label was not found
return "[" + _attribute.Alias + "]";
}