I can't find any examples on how to localize text within a C# asp.net.core application. I would appreciate any help.
I'm assuming that I need to use StringLocalizaer somehow.
Thanks
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.Rendering;
//using Microsoft.Extensions.Localization;
namespace NotificationSystem.Models
{
public class GroupList : List<Group>
{
public GroupList()
{
LoadGroupTypes();
}
protected List<Group> _Groups { get; set; }
public List<SelectListItem> GroupTypes { get; set; }
public List<SelectListItem> LoadGroupTypes()
{
// ToDo: Implement other GroupTypes / DB Settings pull
GroupTypes = new List<SelectListItem>
{
new SelectListItem
{
Text = "USER-STATIC",
Value = "Users List - Static" // ToDo: Globalize
}
};
return GroupTypes;
}
}
}