2022-12-07 14:05:11 +01:00
|
|
|
using FluentValidation;
|
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
namespace zero.Localization;
|
|
|
|
|
|
|
|
|
|
internal class ZeroLocalizationModule : ZeroModule
|
|
|
|
|
{
|
|
|
|
|
public override void ConfigureServices(IServiceCollection services, IConfiguration configuration)
|
|
|
|
|
{
|
|
|
|
|
services.AddScoped<ICultureResolver, CultureResolver>();
|
|
|
|
|
services.AddScoped<ICultureService, CultureService>();
|
2022-12-07 15:20:53 +01:00
|
|
|
services.AddScoped<ILocalizer, FileLocalizer>();
|
|
|
|
|
|
|
|
|
|
services.AddOptions<LocalizationOptions>().Bind(configuration.GetSection("Zero:Localization")).Configure(opts =>
|
|
|
|
|
{
|
|
|
|
|
opts.FilePath = "Config/texts.json";
|
|
|
|
|
});
|
2022-12-07 14:05:11 +01:00
|
|
|
}
|
|
|
|
|
}
|