Adding New Entity Categories

So, I’ve noticed to add a new category into the locale, I have to directly mixinto to stonehearth’s local file by:

mixinto file:
{
  "ui": {
    "game": {
      "entities": {
        "item_categories": {
          "category_name": "Category Display Name"
        }
      }
    }
  }
}
manifest mixinto section:
"stonehearth/locales/en.json": "file(mixintos/category.json)"

Because the game is looking for the i18n entry at stonehearth:ui.game.entities.item_categories.category_name. The issue I see is that people like @Wiese2007 who are on top of making sure translations are good, this isn’t an obvious place to look, and is hardcoded to only mixinto en.json.

Am I correct here, or is there something I’m missing to add a new category that displays it’s name properly?

heyho ^^

here im mentioning @froggy´s cookmod :wink:

the categories are in the stockpile_filter.json - over this he has add two new categories (drinks_container and quest_items) and there it shows to en.json in his cookmod. so you need only to mixin this stockpilefilter^^

{
“stockpile”: {
“food_and_drink”: {
“categories”: {
“drink_container”: {
“ordinal”: 4,
“display_name”: “i18n(cookmod:ui.game.zones_mode.stockpile.filters.tooltip_drink_containers)”,
“icon”: “/cookmod/ui/game/modes/zones_mode/stockpile/images/taxonomy/drink.png”,
“filter”: “drink_container”
}
}
},
“wealth”: {
“categories”: {
“quest_items”: {
“ordinal”: 4,
“display_name”: “i18n(cookmod:ui.game.zones_mode.stockpile.filters.tooltip_quest_items)”,
“icon”: “/cookmod/ui/game/modes/zones_mode/stockpile/images/taxonomy/quest.png”,
“filter”: “quest_items”
}
}
}
}
}

en.json:
“stockpile”: {
“filters”: {
“tooltip_quest_items”: “Quest Items”,
“tooltip_drink_containers”: “Drinks”
}

1 Like

Thanks for pointing me in the right direction. :grinning:

However, he did it the same way that I had figured out, but did his file structure is a way that makes a little more sense than mine. The code you posted all has to do will adding in stockpile filters, but he did indeed add new new categories, ‘drink’ and ‘quest items’. If you look at his en_fix.json file, that’s where he is directly mixing into the stonehearth local file to add the category titles.

So this does in a sense answer my question, that yes you have to mixinto the stonehearth locale for new entity categories, and the downside in translations for mods, is you would have to manually add a mixinto line in the mod manifest that would point to category names for other languages.

I will follow @Froggy’s lead and name mine en_fix.json and store it in the locales folder, makes a lot more sense than my idea.

ohhh you have right ^^ upss xD