Enhance school creation and staffing management with native language support
- Updated protocol documentation to include `nativeLanguages` in `nameSets` and added `nativeLanguage` to school creation options. - Enhanced the UI for school creation to allow selection of native languages, improving user experience. - Revised API interfaces to accommodate new native language features, ensuring proper data handling. - Improved localization strings to support new native language functionalities in both English and Russian. - Updated tests to validate the new native language features and ensure robust functionality in staffing scenarios.
This commit is contained in:
@@ -16,7 +16,8 @@ public static class RosterGenerator
|
||||
MapLayout map,
|
||||
int schoolSeed,
|
||||
string nameSetId,
|
||||
DateTime? asOf = null)
|
||||
DateTime? asOf = null,
|
||||
string? nativeLanguage = null)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(catalog);
|
||||
ArgumentNullException.ThrowIfNull(map);
|
||||
@@ -27,6 +28,7 @@ public static class RosterGenerator
|
||||
throw new ArgumentException($"Unknown name set '{nameSetId}'.", nameof(nameSetId));
|
||||
}
|
||||
|
||||
var native = NativeLanguages.Pick(names, schoolSeed, nativeLanguage, rollIfOmitted: true);
|
||||
var when = DateTime.SpecifyKind(asOf ?? DefaultAsOf, DateTimeKind.Utc);
|
||||
var yearStart = SchoolYears.StartOn(when);
|
||||
var demand = SchoolDemand.From(catalog, map);
|
||||
@@ -36,7 +38,7 @@ public static class RosterGenerator
|
||||
var families = new List<Family>(plans.Count);
|
||||
foreach (var plan in plans)
|
||||
{
|
||||
var (family, members) = FamilyFactory.Create(catalog, names, schoolSeed, plan, yearStart, when);
|
||||
var (family, members) = FamilyFactory.Create(catalog, names, schoolSeed, plan, yearStart, when, native);
|
||||
families.Add(family);
|
||||
people.AddRange(members);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user