using Microsoft.Extensions.Localization;

namespace EggymonLandingPage.Client.Localization;

/// <summary>
/// EN: Factory for creating JSON string localizers.
/// VI: Factory tạo JSON string localizer.
/// </summary>
public class JsonStringLocalizerFactory : IStringLocalizerFactory
{
    private readonly LocalizationCache _cache;
    private readonly IServiceProvider _serviceProvider;

    public JsonStringLocalizerFactory(LocalizationCache cache, IServiceProvider serviceProvider)
    {
        _cache = cache;
        _serviceProvider = serviceProvider;
    }

    public IStringLocalizer Create(Type resourceSource)
    {
        return new JsonStringLocalizer(_cache, resourceSource.Name);
    }

    public IStringLocalizer Create(string baseName, string location)
    {
         return new JsonStringLocalizer(_cache, baseName);
    }
}
