Cataclysm-BN icon indicating copy to clipboard operation
Cataclysm-BN copied to clipboard

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

Open RoyalFox2140 opened this issue 1 year ago • 1 comments

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

  • OS: Windows
    • OS Version: Win 10 Pro for Workstations 64 bit build 19045
  • Game Version: e01f656 [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en_US]
  • Mods loaded: [ Bright Nights [bn], Elevated bridges [elevated_bridges], Craftable Gun Pack [craftgp], Alternative Map Key [alt_map_key], Fuji's Military Profession Pack [fuji_mpp], Arcana and Magic Items [Arcana], Craftable Bullet Casings [CasingCrafting], MST Extra [MST_Extra], Tankmod: Revived [Tankmod_Revived], Essence 2200 [Essence2200], Essence 2200 Tweaks [FoxTweaks], Nonperishable Overhaul [Nonperishable_Overhaul], No Addictions [No_Addictions], Limit Fungal Growth [limit_fungal_growth], Disable NPC Needs [no_npc_food], Urban Development [Urban_Development], Project: Pack Rat [Jake's_Squirrel_mod] ]

Additional context

No response

RoyalFox2140 avatar Sep 10 '23 23:09 RoyalFox2140

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

olanti-p avatar Sep 11 '23 00:09 olanti-p