Added basic authentication and localization

This commit is contained in:
2025-12-14 11:38:32 +01:00
parent 78f52faf46
commit c56b8a7f32
9 changed files with 184 additions and 7 deletions

View 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];
}