Just make a dummy recipe inside data.lua like this:
data:extend { --Periods added for formatting
....{
........type = "recipe",
........name = "item-name-test",
........icon = "base/graphics/icons/uranium-processing.png",
........icon_size = 32,
........subgroup = "raw-material",
........category = "crafting-with-fluid",
........enabled = true,
........ingredients =
........{
........},
........results =
........{
............{type="item", name="iron-plate", amount=1},
............{type="item", name="wooden-chest", amount=1},
............{type="item", name="solar-panel-equipment", amount=1},
............{type="item", name="rail", amount=1},
............{type="item", name="water-barrel", amount=1},
............{type="fluid", name="water", amount=100},
........}
....},
}
I got your mod to work using this function. It takes the product from format_line() and works for both items and fluids.
local get_product_name=function(product) --Periods added for formatting
....if product.type=="fluid" then
........local fluid=data.raw["fluid"][product.name]
........if fluid then
............if fluid.localised_name then
................return fluid.localised_name
............end
........end
........return {"fluid-name." .. product.name}
....else
........local item=data.raw["item"][product.name]
........if item then
............if item.localised_name then
................return item.localised_name
............elseif item.place_result then
................return {"entity-name." .. item.place_result}
............elseif item.placed_as_equipment_result then
................return {"equipment-name." .. item.placed_as_equipment_result}
............end
........end
........return {"item-name." .. product.name}
....end
end
EDIT: Whoops! I forgot that fluids can have localized names too. The code should be correct now