Overview

[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"];
	}
}
public IActionResult Hello(string name)
{
	ViewData["Message"] = _localizer["<b>Hello</b><i> {0}</i>", name];
	return View();
}
private readonly IStringLocalizer _localizer;
private readonly IStringLocalizer _localizer2;

public TestController(IStringLocalizerFactory factory)
{
	var type = typeof(SharedResource);
	var assemblyName = new AssemblyName(type.GetTypeInfo().Assembly.FullName);
	_localizer = factory.Create(type);
	_localizer2 = factory.Create("SharedResource", assemblyName.Name);
}       

public IActionResult About()
{
	ViewData["Message"] = _localizer["Your application description page."] 
		+ " loc 2: " + _localizer2["Your application description page."];
	// ...
}
// Dummy class to group shared resources

namespace Localization.StarterWeb
{
    public class SharedResource
    {
    }
}