From fd888cab4b033a3d58f95607bec2b25c80067807 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 9 Aug 2018 14:36:08 +0200 Subject: [PATCH 01/15] Fixes U4-9095 - the textService.Localize always returns some string, either the translation or [alias] - so we need to make sure it actually translated something --- .../Trees/ApplicationTreeExtensions.cs | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Web/Trees/ApplicationTreeExtensions.cs b/src/Umbraco.Web/Trees/ApplicationTreeExtensions.cs index e2dceef47d..b49d3d2586 100644 --- a/src/Umbraco.Web/Trees/ApplicationTreeExtensions.cs +++ b/src/Umbraco.Web/Trees/ApplicationTreeExtensions.cs @@ -51,17 +51,24 @@ namespace Umbraco.Web.Trees internal static string GetRootNodeDisplayName(this TreeAttribute attribute, ILocalizedTextService textService) { + var label = $"[{attribute.Alias}]"; + // try to look up a the localized tree header matching the tree alias var localizedLabel = textService.Localize("treeHeaders/" + attribute.Alias); - if (string.IsNullOrEmpty(localizedLabel) == false) - return localizedLabel; - - // otherwise return the header if it's defined - if (string.IsNullOrEmpty(attribute.Title) == false) - return attribute.Title; - // if all fails, return this to signal that a label was not found - return "[" + attribute.Alias + "]"; + // if the localizedLabel returns [alias] then return the title attribute from the trees.config file, if it's defined + if (localizedLabel != null && localizedLabel.Equals(label, StringComparison.InvariantCultureIgnoreCase)) + { + if (string.IsNullOrEmpty(attribute.Title) == false) + label = attribute.Title; + } + else + { + // the localizedLabel translated into something that's not just [alias], so use the translation + label = localizedLabel; + } + + return label; } internal static Attempt TryGetControllerTree(this ApplicationTree appTree) From 6c0d14e0f408b37ac3ffd6c7e750799517763996 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 14 Aug 2018 13:14:49 +0200 Subject: [PATCH 02/15] add type="button" to toggle so it doesn't auto-submits a form --- .../src/views/components/buttons/umb-toggle.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-toggle.html b/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-toggle.html index ba9257bac7..fc62485521 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-toggle.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-toggle.html @@ -1,4 +1,4 @@ -