Localize jobs (#8968)

* Localize job supervisors

* Rename supervisors file

* Localize job names

* Remove localization for fallback job name

* Use LocalizedName for Job

* Fix job names case
This commit is contained in:
Morber
2022-06-28 15:55:05 +03:00
committed by GitHub
parent 5dbb3220dd
commit 7a14c6f331
47 changed files with 157 additions and 101 deletions

View File

@@ -202,8 +202,8 @@ namespace Content.Client.LateJoin
var jobLabel = new Label
{
Text = job.Value != null ?
Loc.GetString("late-join-gui-job-slot-capped", ("jobName", prototype.Name), ("amount", job.Value)) :
Loc.GetString("late-join-gui-job-slot-uncapped", ("jobName", prototype.Name))
Loc.GetString("late-join-gui-job-slot-capped", ("jobName", prototype.LocalizedName), ("amount", job.Value)) :
Loc.GetString("late-join-gui-job-slot-uncapped", ("jobName", prototype.LocalizedName))
};
jobSelector.AddChild(jobLabel);

View File

@@ -192,7 +192,7 @@ namespace Content.Client.Preferences.UI
var highPriorityJob = humanoid?.JobPriorities.SingleOrDefault(p => p.Value == JobPriority.High).Key;
if (highPriorityJob != null)
{
var jobName = IoCManager.Resolve<IPrototypeManager>().Index<JobPrototype>(highPriorityJob).Name;
var jobName = IoCManager.Resolve<IPrototypeManager>().Index<JobPrototype>(highPriorityJob).LocalizedName;
description = $"{description}\n{jobName}";
}

View File

@@ -344,7 +344,7 @@ namespace Content.Client.Preferences.UI
var firstCategory = true;
foreach (var job in prototypeManager.EnumeratePrototypes<JobPrototype>().OrderBy(j => j.Name))
foreach (var job in prototypeManager.EnumeratePrototypes<JobPrototype>().OrderBy(j => j.LocalizedName))
{
if(!job.SetPreference) { continue; }
@@ -1033,7 +1033,7 @@ namespace Content.Client.Preferences.UI
Children =
{
icon,
new Label {Text = job.Name, MinSize = (175, 0)},
new Label {Text = job.LocalizedName, MinSize = (175, 0)},
_optionButton
}
});

View File

@@ -67,7 +67,7 @@ namespace Content.Server.Access.Systems
_accessSystem.SetAccessToJob(uid, job, extended);
// and also change job title on a card id
_cardSystem.TryChangeJobTitle(uid, job.Name);
_cardSystem.TryChangeJobTitle(uid, job.LocalizedName);
}
}
}

View File

@@ -65,7 +65,7 @@ namespace Content.Server.GameTicking.Commands
var jobPrototype = _prototypeManager.Index<JobPrototype>(id);
if(stationJobs.TryGetJobSlot(station, jobPrototype, out var slots) == false || slots == 0)
{
shell.WriteLine($"{jobPrototype.Name} has no available slots.");
shell.WriteLine($"{jobPrototype.LocalizedName} has no available slots.");
return;
}
ticker.MakeJoinGame(player, station, id);

View File

@@ -54,7 +54,7 @@ namespace Content.Server.GameTicking
InitializeLobbyMusic();
InitializeLobbyBackground();
InitializeGamePreset();
DebugTools.Assert(_prototypeManager.Index<JobPrototype>(FallbackOverflowJob).Name == Loc.GetString(FallbackOverflowJobName),
DebugTools.Assert(_prototypeManager.Index<JobPrototype>(FallbackOverflowJob).Name == FallbackOverflowJobName,
"Overflow role does not have the correct name!");
InitializeGameRules();

View File

@@ -23,7 +23,7 @@ namespace Content.Server.Roles
public Job(Mind.Mind mind, JobPrototype jobPrototype) : base(mind)
{
Prototype = jobPrototype;
Name = jobPrototype.Name;
Name = jobPrototype.LocalizedName;
CanBeAntag = jobPrototype.CanBeAntag;
}
@@ -40,7 +40,7 @@ namespace Content.Server.Roles
if(Prototype.RequireAdminNotify)
chatMgr.DispatchServerMessage(session, Loc.GetString("job-greet-important-disconnect-admin-notify"));
chatMgr.DispatchServerMessage(session, Loc.GetString("job-greet-supervisors-warning", ("jobName", Name), ("supervisors", Prototype.Supervisors)));
chatMgr.DispatchServerMessage(session, Loc.GetString("job-greet-supervisors-warning", ("jobName", Name), ("supervisors", Loc.GetString(Prototype.Supervisors))));
if(Prototype.JoinNotifyCrew && Mind.CharacterName != null)
{

View File

@@ -173,7 +173,7 @@ public sealed class StationSpawningSystem : EntitySystem
var card = pdaComponent.ContainedID;
var cardId = card.Owner;
_cardSystem.TryChangeFullName(cardId, characterName, card);
_cardSystem.TryChangeJobTitle(cardId, jobPrototype.Name, card);
_cardSystem.TryChangeJobTitle(cardId, jobPrototype.LocalizedName, card);
var extendedAccess = false;
if (station != null)

View File

@@ -10,7 +10,7 @@ namespace Content.Shared.GameTicking
// But this is easier, and at least it isn't hardcoded.
//TODO: Move these, they really belong in StationJobsSystem or a cvar.
public const string FallbackOverflowJob = "Passenger";
public const string FallbackOverflowJobName = "passenger";
public const string FallbackOverflowJobName = "job-name-passenger";
}
[Serializable, NetSerializable]

View File

@@ -26,6 +26,9 @@ namespace Content.Shared.Roles
[DataField("name")]
public string Name { get; } = string.Empty;
[ViewVariables(VVAccess.ReadOnly)]
public string LocalizedName => Loc.GetString(Name);
[DataField("joinNotifyCrew")]
public bool JoinNotifyCrew { get; } = false;

View File

@@ -0,0 +1,39 @@
job-name-warden = warden
job-name-security = security officer
job-name-cadet = security cadet
job-name-hos = head of security
job-name-scientist = scientist
job-name-rd = research director
job-name-psychologist = psychologist
job-name-intern = medical intern
job-name-doctor = medical doctor
job-name-cmo = chief medical officer
job-name-chemist = chemist
job-name-assistant = technical assistant
job-name-engineer = station engineer
job-name-atmostech = atmospheric technician
job-name-hop = head of personnel
job-name-captain = captain
job-name-serviceworker = service worker
job-name-centcomoff = centcom official
job-name-reporter = reporter
job-name-musician = musician
job-name-librarian = librarian
job-name-lawyer = lawyer
job-name-mime = mime
job-name-ce = chief engineer
job-name-janitor = janitor
job-name-chaplain = chaplain
job-name-botanist = botanist
job-name-bartender = bartender
job-name-passenger = passenger
job-name-salvagespec = salvage specialist
job-name-qm = quartermaster
job-name-cargoteh = cargo technician
job-name-chef = chef
job-name-clown = clown
job-name-ertleader = ERT leader
job-name-ertengineer = ERT engineer
job-name-ertsecurity = ERT security
job-name-ertmedic = ERT medic
job-name-ertjanitor = ERT janitor

View File

@@ -0,0 +1,14 @@
job-supervisors-centcom = centcom official
job-supervisors-captain = the captain
job-supervisors-hop = the head of personnel
job-supervisors-hop-qm = the quartermaster and head of personnel
job-supervisors-hos = the head of security
job-supervisors-ce = the chief engineer
job-supervisors-cmo = the chief medical officer
job-supervisors-rd = the research director
job-supervisors-service = chefs, botanists, the bartender, and the head of personnel
job-supervisors-engineering = station engineers, atmospheric technicians, and the chief engineer
job-supervisors-medicine = medical doctors, chemists, and the chief medical officer
job-supervisors-security = security officers, the warden, and the head of security
job-supervisors-hire = whoever hires you
job-supervisors-everyone = absolutely everyone

View File

@@ -1,11 +1,11 @@
- type: job
id: CargoTechnician
name: "cargo technician"
name: job-name-cargoteh
startingGear: CargoTechGear
departments:
- Cargo
icon: "CargoTechnician"
supervisors: "the quartermaster and head of personnel"
supervisors: job-supervisors-hop-qm
access:
- Cargo
- Maintenance

View File

@@ -1,12 +1,12 @@
- type: job
id: Quartermaster
name: "quartermaster"
name: job-name-qm
weight: 10
startingGear: QuartermasterGear
departments:
- Cargo
icon: "QuarterMaster"
supervisors: "the head of personnel"
supervisors: job-supervisors-hop
canBeAntag: false
access:
- Cargo

View File

@@ -1,11 +1,11 @@
- type: job
id: SalvageSpecialist
name: "salvage specialist"
name: job-name-salvagespec
icon: "ShaftMiner"
startingGear: SalvageSpecialistGear
departments:
- Cargo
supervisors: "the quartermaster and head of personnel"
supervisors: job-supervisors-hop-qm
access:
- Cargo
- Salvage

View File

@@ -1,11 +1,11 @@
- type: job
id: Passenger
name: "passenger"
name: job-name-passenger
startingGear: PassengerGear
departments:
- Civilian
icon: "Passenger"
supervisors: "absolutely everyone"
supervisors: job-supervisors-everyone
access:
- Maintenance

View File

@@ -1,11 +1,11 @@
- type: job
id: Bartender
name: "bartender"
name: job-name-bartender
startingGear: BartenderGear
departments:
- Civilian
icon: "Bartender"
supervisors: "the head of personnel"
supervisors: job-supervisors-hop
access:
- Service
- Maintenance

View File

@@ -1,11 +1,11 @@
- type: job
id: Botanist
name: "botanist"
name: job-name-botanist
startingGear: BotanistGear
departments:
- Civilian
icon: "Botanist"
supervisors: "the head of personnel"
supervisors: job-supervisors-hop
access:
- Service
- Maintenance

View File

@@ -1,11 +1,11 @@
- type: job
id: Chaplain
name: "chaplain"
name: job-name-chaplain
startingGear: ChaplainGear
departments:
- Civilian
icon: "Chaplain"
supervisors: "the head of personnel"
supervisors: job-supervisors-hop
access:
- Chapel
- Maintenance

View File

@@ -1,11 +1,11 @@
- type: job
id: Chef
name: "chef"
name: job-name-chef
startingGear: ChefGear
departments:
- Civilian
icon: "Chef"
supervisors: "the head of personnel"
supervisors: job-supervisors-hop
access:
- Service
- Maintenance

View File

@@ -1,11 +1,11 @@
- type: job
id: Clown
name: "clown"
name: job-name-clown
startingGear: ClownGear
departments:
- Civilian
icon: "Clown"
supervisors: "the head of personnel"
supervisors: job-supervisors-hop
access:
- Theatre
- Maintenance

View File

@@ -1,11 +1,11 @@
- type: job
id: Janitor
name: "janitor"
name: job-name-janitor
startingGear: JanitorGear
departments:
- Civilian
icon: "Janitor"
supervisors: "the head of personnel"
supervisors: job-supervisors-hop
access:
- Janitor
- Maintenance

View File

@@ -1,11 +1,11 @@
- type: job
id: Lawyer
name: "lawyer"
name: job-name-lawyer
startingGear: LawyerGear
departments:
- Civilian
icon: "Lawyer"
supervisors: "the head of personnel"
supervisors: job-supervisors-hop
access:
- Service
- Brig

View File

@@ -1,11 +1,11 @@
- type: job
id: Librarian
name: "librarian"
name: job-name-librarian
startingGear: LibrarianGear
departments:
- Civilian
icon: "Librarian"
supervisors: "the head of personnel"
supervisors: job-supervisors-hop
access:
- Service
- Maintenance

View File

@@ -1,11 +1,11 @@
- type: job
id: Mime
name: "mime"
name: job-name-mime
startingGear: MimeGear
departments:
- Civilian
icon: "Mime"
supervisors: "the head of personnel"
supervisors: job-supervisors-hop
access:
- Theatre
- Maintenance

View File

@@ -1,11 +1,11 @@
- type: job
id: Musician
name: "musician"
name: job-name-musician
startingGear: MusicianGear
departments:
- Civilian
icon: "Musician"
supervisors: "whoever hires you"
supervisors: job-supervisors-hire
access:
- Maintenance # TODO Remove maint access for all gimmick jobs once access work is completed
- Theatre

View File

@@ -1,11 +1,11 @@
- type: job
id: Reporter
name: "reporter"
name: job-name-reporter
startingGear: ReporterGear
departments:
- Civilian
icon: "Reporter"
supervisors: "the head of personnel"
supervisors: job-supervisors-hop
access:
- Service
- Maintenance

View File

@@ -1,11 +1,11 @@
- type: job
id: ServiceWorker
name: "service worker"
name: job-name-serviceworker
startingGear: ServiceWorkerGear
departments:
- Civilian
icon: "ServiceWorker"
supervisors: "chefs, botanists, the bartender, and the head of personnel"
supervisors: job-supervisors-service
canBeAntag: false
access:
- Service

View File

@@ -1,6 +1,6 @@
- type: job
id: Captain
name: "captain"
name: job-name-captain
weight: 20
startingGear: CaptainGear
departments:
@@ -8,7 +8,7 @@
icon: "Captain"
requireAdminNotify: true
joinNotifyCrew: true
supervisors: "Nanotrasen officials"
supervisors: job-supervisors-centcom
canBeAntag: false
accessGroups:
- AllAccess

View File

@@ -1,12 +1,12 @@
- type: job
id: CentralCommandOfficial
name: "centcom official"
name: job-name-centcomoff
setPreference: false
startingGear: CentcomGear
departments:
- Command
icon: "Nanotrasen"
supervisors: "the head of security"
supervisors: job-supervisors-hos
canBeAntag: false
accessGroups:
- AllAccess

View File

@@ -1,6 +1,6 @@
- type: job
id: HeadOfPersonnel
name: "head of personnel"
name: job-name-hop
weight: 20
startingGear: HoPGear
departments:
@@ -8,7 +8,7 @@
- Civilian
icon: "HeadOfPersonnel"
requireAdminNotify: true
supervisors: "the captain"
supervisors: job-supervisors-captain
canBeAntag: false
access:
- Command

View File

@@ -1,11 +1,11 @@
- type: job
id: AtmosphericTechnician
name: "atmospheric technician"
name: job-name-atmostech
startingGear: AtmosphericTechnicianGear
departments:
- Engineering
icon: "AtmosphericTechnician"
supervisors: "the chief engineer"
supervisors: job-supervisors-ce
canBeAntag: false
access:
- Maintenance

View File

@@ -1,6 +1,6 @@
- type: job
id: ChiefEngineer
name: "chief engineer"
name: job-name-ce
weight: 10
startingGear: ChiefEngineerGear
departments:
@@ -8,7 +8,7 @@
- Engineering
icon: "ChiefEngineer"
requireAdminNotify: true
supervisors: "the captain"
supervisors: job-supervisors-captain
canBeAntag: false
access:
- Maintenance

View File

@@ -1,11 +1,11 @@
- type: job
id: StationEngineer
name: "station engineer"
name: job-name-engineer
startingGear: StationEngineerGear
departments:
- Engineering
icon: "StationEngineer"
supervisors: "the chief engineer"
supervisors: job-supervisors-ce
access:
- Maintenance
- Engineering

View File

@@ -1,12 +1,12 @@
- type: job
id: TechnicalAssistant
name: "technical assistant"
name: job-name-assistant
startingGear: TechnicalAssistantGear
departments:
- Civilian
- Engineering
icon: "TechnicalAssistant"
supervisors: "station engineers, atmospheric technicians, and the chief engineer"
supervisors: job-supervisors-engineering
canBeAntag: false
access:
- Maintenance

View File

@@ -1,13 +1,13 @@
# Leader
- type: job
id: ERTLeader
name: "ERT leader"
name: job-name-ertleader
setPreference: false
startingGear: ERTLeaderGearEVA
departments:
- Command
icon: "Nanotrasen"
supervisors: "centcom official"
supervisors: job-supervisors-centcom
canBeAntag: false
accessGroups:
- AllAccess
@@ -48,13 +48,13 @@
# Engineer
- type: job
id: ERTEngineer
name: "ERT engineer"
name: job-name-ertengineer
setPreference: false
startingGear: ERTEngineerGearEVA
departments:
- Command
icon: "Nanotrasen"
supervisors: "centcom official"
supervisors: job-supervisors-centcom
canBeAntag: false
accessGroups:
- AllAccess
@@ -94,13 +94,13 @@
# Security
- type: job
id: ERTSecurity
name: "ERT security"
name: job-name-ertsecurity
setPreference: false
startingGear: ERTEngineerGearEVA
departments:
- Command
icon: "Nanotrasen"
supervisors: "centcom official"
supervisors: job-supervisors-centcom
canBeAntag: false
accessGroups:
- AllAccess
@@ -140,13 +140,13 @@
# Medical
- type: job
id: ERTMedical
name: "ERT medic"
name: job-name-ertmedic
setPreference: false
startingGear: ERTMedicalGearEVA
departments:
- Command
icon: "Nanotrasen"
supervisors: "centcom official"
supervisors: job-supervisors-centcom
canBeAntag: false
accessGroups:
- AllAccess
@@ -187,13 +187,13 @@
# Janitor
- type: job
id: ERTJanitor
name: "ERT janitor"
name: job-name-ertjanitor
setPreference: false
startingGear: ERTJanitorGearEVA
departments:
- Command
icon: "Nanotrasen"
supervisors: "centcom official"
supervisors: job-supervisors-centcom
canBeAntag: false
accessGroups:
- AllAccess

View File

@@ -1,11 +1,11 @@
- type: job
id: Chemist
name: "chemist"
name: job-name-chemist
startingGear: ChemistGear
departments:
- Medical
icon: "Chemist"
supervisors: "the chief medical officer"
supervisors: job-supervisors-cmo
access:
- Medical
- Chemistry

View File

@@ -2,7 +2,7 @@
- type: job
id: ChiefMedicalOfficer
name: "chief medical officer"
name: job-name-cmo
weight: 10
startingGear: CMOGear
departments:
@@ -10,7 +10,7 @@
- Medical
icon: "ChiefMedicalOfficer"
requireAdminNotify: true
supervisors: "the captain"
supervisors: job-supervisors-captain
canBeAntag: false
access:
- Medical

View File

@@ -1,11 +1,11 @@
- type: job
id: MedicalDoctor
name: "medical doctor"
name: job-name-doctor
startingGear: DoctorGear
departments:
- Medical
icon: "MedicalDoctor"
supervisors: "the chief medical officer"
supervisors: job-supervisors-cmo
access:
- Medical
- Maintenance

View File

@@ -1,12 +1,12 @@
- type: job
id: MedicalIntern
name: "medical intern"
name: job-name-intern
startingGear: MedicalInternGear
departments:
- Civilian
- Medical
icon: "MedicalIntern"
supervisors: "medical doctors, chemists, and the chief medical officer"
supervisors: job-supervisors-medicine
canBeAntag: false
access:
- Medical

View File

@@ -1,11 +1,11 @@
- type: job
id: Psychologist
name: "psychologist"
name: job-name-psychologist
startingGear: PsychologistGear
departments:
- Medical
icon: "Psychologist"
supervisors: "the chief medical officer"
supervisors: job-supervisors-cmo
access:
- Medical
- Maintenance

View File

@@ -1,6 +1,6 @@
- type: job
id: ResearchDirector
name: "research director"
name: job-name-rd
weight: 10
startingGear: ResearchDirectorGear
departments:
@@ -8,7 +8,7 @@
- Science
icon: "ResearchDirector"
requireAdminNotify: true
supervisors: "the captain"
supervisors: job-supervisors-captain
canBeAntag: false
access:
- Research

View File

@@ -1,11 +1,11 @@
- type: job
id: Scientist
name: "scientist"
name: job-name-scientist
startingGear: ScientistGear
departments:
- Science
icon: "Scientist"
supervisors: "the research director"
supervisors: job-supervisors-rd
access:
- Research
- Maintenance

View File

@@ -1,6 +1,6 @@
- type: job
id: HeadOfSecurity
name: "head of security"
name: job-name-hos
weight: 10
startingGear: HoSGear
departments:
@@ -8,7 +8,7 @@
- Security
icon: "HeadOfSecurity"
requireAdminNotify: true
supervisors: "the captain"
supervisors: job-supervisors-captain
canBeAntag: false
access:
- HeadOfSecurity

View File

@@ -1,12 +1,12 @@
- type: job
id: SecurityCadet
name: "security cadet"
name: job-name-cadet
startingGear: SecurityCadetGear
departments:
- Civilian
- Security
icon: "SecurityCadet"
supervisors: "security officers, the warden, and the head of security"
supervisors: job-supervisors-security
canBeAntag: false
access:
- Security

View File

@@ -1,11 +1,11 @@
- type: job
id: SecurityOfficer
name: "security officer"
name: job-name-security
startingGear: SecurityOfficerGear
departments:
- Security
icon: "SecurityOfficer"
supervisors: "the head of security"
supervisors: job-supervisors-hos
canBeAntag: false
access:
- Security

View File

@@ -1,11 +1,11 @@
- type: job
id: Warden
name: "warden"
name: job-name-warden
startingGear: WardenGear
departments:
- Security
icon: "Warden"
supervisors: "the head of security"
supervisors: job-supervisors-hos
canBeAntag: false
access:
- Security