cataclysmbnteam / Cataclysm-BN

Cataclysm: Bright Nights, A fork/variant of Cataclysm:DDA by CleverRaven.
https://docs.cataclysmbn.org
Other
688 stars 271 forks source link

Translation strings not correctly applied on a recipe book unless its learned #3129

Open RoyalFox2140 opened 1 year ago

RoyalFox2140 commented 1 year ago

Describe the bug

A recipe remains untranslated within a recipe book, UNLESS IF YOU LEARN THE RECIPE. Screenshots will demonstrate this.

It doesn't apply the translation unless you already know the recipe, but it still correctly shows on the crafting menu. It only has this issue on the recipe book itself.

Steps To Reproduce

  1. Find a mod with crafting recipes and recipe books that is not natively in English but has translation strings for english.
  2. Get the recipe book without knowing the recipe.
  3. Now learn all recipes via debug.

Screenshots

image image image

Versions and configuration

Additional context

No response

olanti-p commented 1 year ago

Apparently books can give their own names to the recipes, which are shown instead of proper names until you learn them, and those custom names aren't translated (elem.name here is just the plain string loaded from JSON) https://github.com/cataclysmbnteam/Cataclysm-BN/blob/3702256ff8c618942a2e124b63b81e0f88283a4a/src/item.cpp#L3023-L3032 Changing this field to be of type translation (and fixing possible compile errors after that) should be enough to fix this. https://github.com/cataclysmbnteam/Cataclysm-BN/blob/3702256ff8c618942a2e124b63b81e0f88283a4a/src/itype.h#L372