[2.1.11] Recipe ignores localised_name of derived main_product when its internal name differs
Posted: Mon Jul 20, 2026 1:41 pm
When declaring a RecipePrototype whose internal name is different to that of the explicitly declared main_product, or implicitly derived from having a sole result, the localised_name of the main_product is ignored and not inherited.
In Factorio 1.1 this did work, but in 2.0/2.1 it has stopped working, but the documentation for main_product has been largely unchanged since 1.1.
Here is a simple reproduction mod with the following code in its data-updates.lua to change the internal name of an existing recipe:
The recipe shows up separately from the item in Factoriopedia, which is expected because they no longer share their internal names. As documented in RecipePrototype::main_product, the recipe takes its subgroup/icon (and also the order) from the main product, but not the localised name.
I am expecting the localised_name to be inherited from the "iron-gear-wheel" item product (because it is the sole product and main_product = nil), so the recipe name shows as "Iron gear wheel".
----------------
There are a few variations of this behaviour that I have tested as well:
In Factorio 1.1 this did work, but in 2.0/2.1 it has stopped working, but the documentation for main_product has been largely unchanged since 1.1.
Here is a simple reproduction mod with the following code in its data-updates.lua to change the internal name of an existing recipe:
Code: Select all
local gear = data.raw.recipe["iron-gear-wheel"]
data.raw.recipe["iron-gear-wheel"] = nil
gear.name = "iron-gear-recipe"
data:extend{gear}
I am expecting the localised_name to be inherited from the "iron-gear-wheel" item product (because it is the sole product and main_product = nil), so the recipe name shows as "Iron gear wheel".
----------------
There are a few variations of this behaviour that I have tested as well:
- Using a fluid recipe with a sole fluid result does the same thing too.
- Leaving the recipe name as "iron-gear-wheel", but adding a new product to the recipe means that the localised name will only be inherited if the main_product = "iron-gear-wheel", and it can never inherit from the newly added product.
- Explicitly declaring the localised_name on the RecipePrototype will always use that value as expected.