Add project data
This commit is contained in:
15
Tabletop.Core/Models/Abstract/LocalizationModelBase.cs
Normal file
15
Tabletop.Core/Models/Abstract/LocalizationModelBase.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.Globalization;
|
||||
using Tabletop.Core.Interfaces;
|
||||
|
||||
namespace Tabletop.Core.Models.Abstract
|
||||
{
|
||||
public abstract class LocalizationModelBase<T> where T : ILocalizationHelper
|
||||
{
|
||||
public List<T> Description { get; set; } = [];
|
||||
public T? GetLocalization(CultureInfo culture)
|
||||
{
|
||||
var description = Description.FirstOrDefault(x => x.Code.Equals(culture.TwoLetterISOLanguageName, StringComparison.OrdinalIgnoreCase));
|
||||
return description;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user