From cb06442de44d93b6437fcf4fa92bb4d12dc68f5e Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 29 Jul 2021 13:54:05 +0200 Subject: [PATCH] Fix: Issue when upgraded from 8.14 to 8.15 when inviting user into the backoffice. #10746 (#10767) * Remove unusable method * Fixes #10746 by removing the recursive call ending in an infinite loop Also: the culture is already known, don't take the `CurrentUICulture` --- .../LocalizedTextServiceExtensions.cs | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/src/Umbraco.Core/Services/LocalizedTextServiceExtensions.cs b/src/Umbraco.Core/Services/LocalizedTextServiceExtensions.cs index 2911441578..e062f11306 100644 --- a/src/Umbraco.Core/Services/LocalizedTextServiceExtensions.cs +++ b/src/Umbraco.Core/Services/LocalizedTextServiceExtensions.cs @@ -71,30 +71,6 @@ namespace Umbraco.Core.Services #pragma warning restore CS0618 // Type or member is obsolete } - /// - /// Localize using the current thread culture - /// - /// - /// - /// - /// - /// - public static string Localize(this ILocalizedTextService manager, string area, string alias, IDictionary tokens = null) - { - if (manager is ILocalizedTextService2 manager2) - { - return manager2.Localize(area, alias, Thread.CurrentThread.CurrentUICulture, tokens); - } - var fullKey = alias; - if (area != null) - { - fullKey = string.Concat(area, "/", alias); - } -#pragma warning disable CS0618 // Type or member is obsolete - return manager.Localize(fullKey, Thread.CurrentThread.CurrentUICulture, tokens); -#pragma warning restore CS0618 // Type or member is obsolete - } - /// /// Localize a key without any variables /// @@ -108,7 +84,7 @@ namespace Umbraco.Core.Services { if (manager is ILocalizedTextService2 manager2) { - return manager2.Localize(area, alias, Thread.CurrentThread.CurrentUICulture, tokens); + return manager2.Localize(area, alias, culture, ConvertToDictionaryVars(tokens)); } var fullKey = alias; if (area != null)