.Net Core

Alternative Localization for Asp.Net Core Applications

Asp.Net Core Built-In Support This is code fragment from official documentation how to localize content using built-in functionality. App Content Localization [Route("api/[controller]")] public class AboutController : Controller { private readonly IStringLocalizer<AboutController> _localizer; public AboutController(IStringLocalizer<AboutController> localizer) { _localizer = localizer; } [HttpGet] public string Get() { return _localizer["About Title"]; } } And if you are working with Html content that shouldn't be escaped during rendering - you are using IHtmlLocalizer implementation that returns LocalizedHtmlString instance. public class BookController : Controller { private readonly IHtmlLocalizer<BookController&…

Keep reading