Added basic authentication and localization
This commit is contained in:
18
src/Server/Services/LocalizationService.cs
Normal file
18
src/Server/Services/LocalizationService.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Microsoft.Extensions.Localization;
|
||||
|
||||
namespace Server.Services;
|
||||
|
||||
public class LocalizationService
|
||||
{
|
||||
private readonly IStringLocalizer _localizer;
|
||||
|
||||
public LocalizationService(IStringLocalizerFactory factory)
|
||||
{
|
||||
_localizer = factory.Create("SharedResources", "Server");
|
||||
}
|
||||
|
||||
public string Get(string key) => _localizer[key];
|
||||
|
||||
public string this[string key] => _localizer[key];
|
||||
public string this[string key, params object[] args] => _localizer[key, args];
|
||||
}
|
||||
Reference in New Issue
Block a user