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:
@@ -206,7 +206,8 @@ internal sealed record ApplicantResponse(
|
||||
bool IsParent,
|
||||
float HourlyWageAsk,
|
||||
float MonthlyBase,
|
||||
IReadOnlyList<LabeledStatResponse> Skills);
|
||||
IReadOnlyList<LabeledStatResponse> Skills,
|
||||
IReadOnlyList<DefLabelResponse> Traits);
|
||||
|
||||
internal sealed record StaffMemberResponse(
|
||||
string Id,
|
||||
@@ -257,7 +258,8 @@ internal static class StaffingMapper
|
||||
applicant.Person.IsParent,
|
||||
applicant.HourlyWageAsk,
|
||||
rules is null ? 0f : Staffing.MonthlyBase(rules, applicant.HourlyWageAsk),
|
||||
StrongSkills(applicant.Person, catalog, locale)))
|
||||
SkillsOf(applicant.Person, catalog, locale),
|
||||
TraitsOf(applicant.Person, catalog, locale)))
|
||||
.ToArray();
|
||||
|
||||
var staff = roster.People
|
||||
@@ -290,12 +292,11 @@ internal static class StaffingMapper
|
||||
return new StaffingResponse(allocated, payroll, remaining, uncovered, applicants, staff, positions, subjects);
|
||||
}
|
||||
|
||||
private static IReadOnlyList<LabeledStatResponse> StrongSkills(Person person, DefCatalog? catalog, string locale)
|
||||
private static IReadOnlyList<LabeledStatResponse> SkillsOf(Person person, DefCatalog? catalog, string locale)
|
||||
{
|
||||
return person.Skills
|
||||
.OrderByDescending(pair => pair.Value)
|
||||
.ThenBy(pair => pair.Key, StringComparer.Ordinal)
|
||||
.Take(3)
|
||||
.Select(pair => new LabeledStatResponse(
|
||||
pair.Key,
|
||||
catalog is not null && catalog.Skills.TryGetValue(pair.Key, out var def)
|
||||
@@ -305,6 +306,17 @@ internal static class StaffingMapper
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
private static IReadOnlyList<DefLabelResponse> TraitsOf(Person person, DefCatalog? catalog, string locale)
|
||||
{
|
||||
return person.Traits
|
||||
.Select(name => new DefLabelResponse(
|
||||
name,
|
||||
catalog is not null && catalog.Traits.TryGetValue(name, out var def)
|
||||
? catalog.Label(locale, def)
|
||||
: name))
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
private static StaffMemberResponse Member(
|
||||
Person person,
|
||||
Roster roster,
|
||||
|
||||
Reference in New Issue
Block a user