]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Localize all dataset names (#32893)
authorMilenVolf <63782763+MilenVolf@users.noreply.github.com>
Sat, 8 Mar 2025 19:04:26 +0000 (22:04 +0300)
committerGitHub <noreply@github.com>
Sat, 8 Mar 2025 19:04:26 +0000 (20:04 +0100)
* 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

Content.Shared/Humanoid/NamingSystem.cs

index 76487ff5228b0890bc50edd85bc40965af2bbfd8..f3af6b5aa14e802933d4233452c91af16aa65c45 100644 (file)
@@ -1,5 +1,6 @@
 using Content.Shared.Humanoid.Prototypes;
 using Content.Shared.Dataset;
+using Content.Shared.Random.Helpers;
 using Robust.Shared.Random;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Enums;
@@ -47,20 +48,20 @@ namespace Content.Shared.Humanoid
             switch (gender)
             {
                 case Gender.Male:
-                    return _random.Pick(_prototypeManager.Index<DatasetPrototype>(speciesProto.MaleFirstNames).Values);
+                    return _random.Pick(_prototypeManager.Index<LocalizedDatasetPrototype>(speciesProto.MaleFirstNames));
                 case Gender.Female:
-                    return _random.Pick(_prototypeManager.Index<DatasetPrototype>(speciesProto.FemaleFirstNames).Values);
+                    return _random.Pick(_prototypeManager.Index<LocalizedDatasetPrototype>(speciesProto.FemaleFirstNames));
                 default:
                     if (_random.Prob(0.5f))
-                        return _random.Pick(_prototypeManager.Index<DatasetPrototype>(speciesProto.MaleFirstNames).Values);
+                        return _random.Pick(_prototypeManager.Index<LocalizedDatasetPrototype>(speciesProto.MaleFirstNames));
                     else
-                        return _random.Pick(_prototypeManager.Index<DatasetPrototype>(speciesProto.FemaleFirstNames).Values);
+                        return _random.Pick(_prototypeManager.Index<LocalizedDatasetPrototype>(speciesProto.FemaleFirstNames));
             }
         }
 
         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));
         }
     }
 }