Localize all dataset names (#32893)

* Use `LocalizedDatasetPrototype` instead of `DatasetPrototype` in `RoleLoadoutPrototype`

* Localize ai names

* Replace to `LocalizedDatasetPrototype` in `NamingSystem`

* Localize arachnid first and last names

* Localize atv names

* Localize autoborg names

* Forgot to change type to localizedDataset

* Localize borer names

* Localize borg names

* Localize cargo shuttle names

* Localize clown names

* Localize death_commando names

* Localize diona names

* Localize fake_human names

* Localize first and last names

* Localize first male and female names

* Localize fortunes descriptions

* Forgot about equal sign

* Localize golem names

* Localize hologram names

* Localize military names

* Localize moth first male and female names

* Localize moth last names

* Fix autoborg name error

* Localize mushman first and last names

* Localize ninja names

* Localize operation names

* Localize regalrat names

* Fix mushman_first

* Forgot about `Loc.GetString`

* Move comments into comment section & fix names

* Localize reptilian male and female names

* Localize revenant names

* Fix locale word order in operation

* Localize rollie (btw it was never used and was added as "for the futuгe" long time ago)

* Localize skeleton_first names

* Localize syndicate names

* Localize vox names

* Localize wizard first and last names

* `{owner}-name-dataset` -> `names-{owner}-dataset`

* Change `DatasetPrototype` to `LocalizedDatasetPrototype` and make sure it works properly

GetFTLName is no more the static method, we need it to be able to use `Loc.GetString`

* I hate those mothname comments

* Combine name datasets prototypes

* Move every ftl from` /en-US/names` to ` /en-US/datasets/names`

* Remove ftl files

* Get every dataset yml back

* Remove changes for planets. Move it in another PR

* Revert these changes (Moved to another PR)

* How

* Apply suggested changes
This commit is contained in:
MilenVolf
2025-03-08 22:04:26 +03:00
committed by GitHub
parent b1fabb5a1a
commit 1abd2d3a08

View File

@@ -1,5 +1,6 @@
using Content.Shared.Humanoid.Prototypes; using Content.Shared.Humanoid.Prototypes;
using Content.Shared.Dataset; using Content.Shared.Dataset;
using Content.Shared.Random.Helpers;
using Robust.Shared.Random; using Robust.Shared.Random;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Enums; using Robust.Shared.Enums;
@@ -47,20 +48,20 @@ namespace Content.Shared.Humanoid
switch (gender) switch (gender)
{ {
case Gender.Male: case Gender.Male:
return _random.Pick(_prototypeManager.Index<DatasetPrototype>(speciesProto.MaleFirstNames).Values); return _random.Pick(_prototypeManager.Index<LocalizedDatasetPrototype>(speciesProto.MaleFirstNames));
case Gender.Female: case Gender.Female:
return _random.Pick(_prototypeManager.Index<DatasetPrototype>(speciesProto.FemaleFirstNames).Values); return _random.Pick(_prototypeManager.Index<LocalizedDatasetPrototype>(speciesProto.FemaleFirstNames));
default: default:
if (_random.Prob(0.5f)) if (_random.Prob(0.5f))
return _random.Pick(_prototypeManager.Index<DatasetPrototype>(speciesProto.MaleFirstNames).Values); return _random.Pick(_prototypeManager.Index<LocalizedDatasetPrototype>(speciesProto.MaleFirstNames));
else else
return _random.Pick(_prototypeManager.Index<DatasetPrototype>(speciesProto.FemaleFirstNames).Values); return _random.Pick(_prototypeManager.Index<LocalizedDatasetPrototype>(speciesProto.FemaleFirstNames));
} }
} }
public string GetLastName(SpeciesPrototype speciesProto) public string GetLastName(SpeciesPrototype speciesProto)
{ {
return _random.Pick(_prototypeManager.Index<DatasetPrototype>(speciesProto.LastNames).Values); return Loc.GetString(_random.Pick(_prototypeManager.Index<LocalizedDatasetPrototype>(speciesProto.LastNames).Values));
} }
} }
} }