Switched to using ASP.Net Core localization.

This commit is contained in:
2022-04-25 00:43:53 -05:00
parent 5f2f648eaa
commit 0488df2ed1
8 changed files with 62 additions and 125 deletions

View File

@@ -1,29 +0,0 @@
using System.IO;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json.Linq;
using Props.Options;
namespace Props.Services.Content
{
public class CachedTextualManager<TPage> : ITextualManager<TPage>
{
private dynamic data;
private readonly TextualOptions options;
private readonly string fileName;
dynamic ITextualManager<TPage>.Json
{
get
{
if (data == null) data = JValue.Parse(File.ReadAllText(Path.Combine(options.Dir, fileName)));
return data;
}
}
public CachedTextualManager(IConfiguration configuration)
{
this.options = configuration.GetSection(TextualOptions.Textual).Get<TextualOptions>();
this.fileName = typeof(TPage).Name.Replace("Model", "") + ".json";
}
}
}

View File

@@ -1,8 +0,0 @@
namespace Props.Services.Content
{
public interface ITextualManager<out TModel>
{
// TODO: Replace this system with globalization and localization. See: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/localization?view=aspnetcore-6.0
dynamic Json { get; }
}
}