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.

