Compare commits
2 Commits
c559662286
...
401e742ea3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
401e742ea3 | ||
|
|
5f84f6bcab |
@@ -1,5 +1,4 @@
|
||||
using DigitalData.Core.Contracts.Application;
|
||||
using DigitalData.Core.DTO;
|
||||
using DigitalData.Core.DTO;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Text;
|
||||
|
||||
|
||||
@@ -55,5 +55,12 @@ namespace DigitalData.Core.API
|
||||
app.UseRequestLocalization(options);
|
||||
return app;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts all localized strings to a dictionary.
|
||||
/// </summary>
|
||||
/// <param name="localizer">The <see cref="IStringLocalizer"/> instance containing the localized strings.</param>
|
||||
/// <returns>A dictionary containing all localized strings, where the key is the name of the string and the value is the localized value.</returns>
|
||||
public static Dictionary<string, string> ToDictionary(this IStringLocalizer localizer) => localizer.GetAllStrings().ToDictionary(ls => ls.Name, ls => ls.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user