CultureInfo zur Culture hinzugefügt und die Benutzeroberfläche aktualisiert, um den NativeName für eine verbesserte Lokalisierung anzuzeigen.
This commit is contained in:
@@ -1,8 +1,18 @@
|
||||
namespace EnvelopeGenerator.Web.Models
|
||||
using System.Globalization;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Models
|
||||
{
|
||||
public class Culture
|
||||
{
|
||||
public string Language { get; init; } = string.Empty;
|
||||
private string _language = string.Empty;
|
||||
public string Language { get => _language;
|
||||
init {
|
||||
_language = value;
|
||||
Info = new(value);
|
||||
}
|
||||
}
|
||||
public string FIClass { get; init; } = string.Empty;
|
||||
|
||||
public CultureInfo? Info { get; init; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,10 +6,8 @@
|
||||
|
||||
public IEnumerable<string> FIClasses => this.Select(c => c.FIClass);
|
||||
|
||||
public Culture? CultureOf(string? language) => language is null ? null : this.Where(c => c.Language == language).FirstOrDefault();
|
||||
|
||||
public Culture Default => this.First();
|
||||
|
||||
public string FIClassOf(string? language) => language is null ? string.Empty : CultureOf(language)?.FIClass ?? string.Empty;
|
||||
|
||||
public Culture? this[string? language] => language is null ? null : this.Where(c => c.Language == language).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user