Refactored all references from Cultures to MultiCulture in controllers and base classes. Updated the class definition in MultiCulture.cs to improve clarity and consistency in culture-related functionality. No functional changes were made.
15 lines
573 B
C#
15 lines
573 B
C#
namespace EnvelopeGenerator.Web.Models
|
|
{
|
|
public class MultiCulture : List<Culture>
|
|
{
|
|
public IEnumerable<string> Languages => this.Select(c => c.Language);
|
|
|
|
public IEnumerable<string> FIClasses => this.Select(c => c.FIClass);
|
|
|
|
public Culture Default => this.First();
|
|
|
|
public Culture GetOrDefault(string? language) => this[language] ?? Default;
|
|
|
|
public Culture? this[string? language] => language is null ? null : this.FirstOrDefault(c => string.Equals(c.Language, language, StringComparison.OrdinalIgnoreCase));
|
|
}
|
|
} |