🧱 Localization infrastructure
This commit is contained in:
		| @@ -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)); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user