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`
This commit is contained in:
Sebastiaan Janssen
2021-07-29 13:54:05 +02:00
committed by GitHub
parent 905b43f8af
commit cb06442de4

View File

@@ -71,30 +71,6 @@ namespace Umbraco.Core.Services
#pragma warning restore CS0618 // Type or member is obsolete
}
/// <summary>
/// Localize using the current thread culture
/// </summary>
/// <param name="manager"></param>
/// <param name="area"></param>
/// <param name="alias"></param>
/// <param name="tokens"></param>
/// <returns></returns>
public static string Localize(this ILocalizedTextService manager, string area, string alias, IDictionary<string, string> 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
}
/// <summary>
/// Localize a key without any variables
/// </summary>
@@ -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)