Convert string[] to dictionary vars

This commit is contained in:
Mole
2021-07-13 15:20:50 +02:00
parent 19c3a1fa47
commit 3b611d6551

View File

@@ -55,7 +55,7 @@ namespace Umbraco.Extensions
/// <param name="tokens"></param>
/// <returns></returns>
public static string Localize(this ILocalizedTextService manager, string area, string alias, CultureInfo culture, string[] tokens)
=> manager.Localize(area, alias, Thread.CurrentThread.CurrentUICulture, tokens);
=> manager.Localize(area, alias, Thread.CurrentThread.CurrentUICulture, ConvertToDictionaryVars(tokens));
/// <summary>
/// Convert an array of strings to a dictionary of indices -> values
@@ -88,7 +88,7 @@ namespace Umbraco.Extensions
var areaAndKey = text.Split('_');
if (areaAndKey.Length < 2)
if (areaAndKey.Length < 2)
return text;
value = manager.Localize(areaAndKey[0], areaAndKey[1]);