using Microsoft.AspNetCore.Html; using Microsoft.AspNetCore.Mvc.Localization; using Microsoft.Extensions.Localization; using Saxonite.Net.Core.Web.Base.App; using System; using System.Collections.Generic; using System.Linq; using System.Resources; using System.Web; namespace Saxonite.Net.Core.Web { // /// Dummy classes to group shared resources - named as per '.resx' file in root namespace. /// Required to create the IStringLocalizer instance using the type from the class. /// Name of the class is used as the prefix for localisation filenames. /// Resource files are in the Localization ResourcesPath in Startup.cs. /// public class SaxOnlineProperties { } // Class must be in Root/Default Namespace to reference properties with same name. // NB 'Assembly name' must be the same as 'Default Namespace' until 'Root Namespace' can be set (.Net Core 2.1?). // Ref. Project Properties - Application. } namespace Saxonite.Net.Core.Web.Online.App { //======================================================================= public class SaxLocaliser_Online : SaxLocaliser { //------------------------------------------------------------------- // Data members. private readonly IStringLocalizer webAppProperties; //------------------------------------------------------------------- /// /// Localisers are supplied using construction injection. /// public SaxLocaliser_Online(IStringLocalizer webAppProperties) { this.webAppProperties = webAppProperties; } //------------------------------------------------------------------- // Properties. public override IStringLocalizer MainProperties { get { return webAppProperties; } } //------------------------------------------------------------------- } //======================================================================= }