🧱 Localization infrastructure

This commit is contained in:
2025-05-08 01:55:32 +08:00
parent ee7dc31b20
commit 891dbfb255
19 changed files with 815 additions and 9 deletions

View File

@ -1,10 +1,13 @@
using System.Globalization;
using DysonNetwork.Sphere.Localization;
using DysonNetwork.Sphere.Permission;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Localization;
namespace DysonNetwork.Sphere.Account;
public class AccountService(AppDatabase db, PermissionService pm, IMemoryCache cache)
public class AccountService(AppDatabase db, PermissionService pm, IMemoryCache cache, IStringLocalizerFactory localizerFactory)
{
public async Task PurgeAccountCache(Account account)
{
@ -31,4 +34,9 @@ public class AccountService(AppDatabase db, PermissionService pm, IMemoryCache c
return null;
}
public IStringLocalizer GetEventLocalizer(string language)
{
return localizerFactory.Create(language, nameof(AccountEventResource));
}
}