Open HairyDude opened 11 years ago
This was something that I was never completely happy with and as noted isn't very reliable. I did this because the way the sites and populations export lists site populations. For searching purposes I wanted it to always use the plural form. So in various places sometimes there are multiple plural forms for the same type of population. For the most part it works though.
I chose not to use raws because I didn't want the viewer to rely on additional files. I preferred to just work with the encapsulated data of the exported files as they are easy to move around without relying on the DF installation directory. Also a lot of extra work for something minor.
One of those functions needs to be removed though.
Fair enough, though it does mean you can only handle vanilla DF and not mods. (For reference, I'm using vanilla, so it doesn't matter anyway.)
IIRC, the cases I mentioned at the end are all the ones I could find (again in vanilla), so maybe they can be special-cased, which would certainly be quicker and easier than diving into parsing raws. In any case the leader positions should use MakePopulationPlural() (or similar).
We could easily set up a dictionary for pluralizing nouns, at least for the vanilla game. If we want to make it correct for mods we could make a dictionary file and then include a tool that could parse raws and add to the file.
What we have now is two identical functions, LegendsViewer.AppHelpers.MakePopulationPlural() and LegendsViewer.Legends.Formatting.MakePopulationPlural(). These attempt to pluralise nouns based on rules, but in English this doesn't work in general. For example suppose a mod added hippo men with the name "giff", plural "giff"; these functions would produce "gifves". On the other hand there is "mastiff", plural "mastiffs" (Legends Viewer would say "mastifves"), and of course "dwarf", plural "dwarves".
There's also pluralisation of leader titles in LegendsViewer.Controls.EntityPrinter.PrintLeaders() that is even more simplistic, just adding "s" on the end. A mod adding a title "Grand Magus" (plural "Grand Magi") would show up in Legends Viewer as "Grand Maguss".
This unpredictability is why DF raws specify plural forms. If it's at all possible, Legends-Viewer should get plurals from raws instead of trying to figure them out.
Races in vanilla DF that are currently wrong include "princesss", "geeses", "sheeps" and (IMO) "buffalos".