Convert string[] to dictionary vars
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user