Integrierte Mehrsprachigkeit (Deutsch und Englisch) mit Cookie-basierter Sprachauswahl

This commit is contained in:
Developer 02
2024-05-15 16:11:26 +02:00
parent cf9286e4c3
commit 68714c2937
32 changed files with 282 additions and 253 deletions

View File

@@ -0,0 +1,8 @@
namespace EnvelopeGenerator.Web.Models
{
public class Culture
{
public string Language { get; init; } = string.Empty;
public string FIClass { get; init; } = string.Empty;
}
}

View File

@@ -0,0 +1,15 @@
namespace EnvelopeGenerator.Web.Models
{
public class Cultures : List<Culture>
{
public IEnumerable<string> Languages => this.Select(c => c.Language);
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;
}
}