Rename Cultures class to MultiCulture throughout codebase
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.
This commit is contained in:
15
EnvelopeGenerator.Web/Models/MultiCulture.cs
Normal file
15
EnvelopeGenerator.Web/Models/MultiCulture.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user