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

@@ -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)