An item that is used to place an entity looks up it's name as "entity-name.whatever" (literally) even if the entity prototype specifies a dynamic name in the prototype. (Additionally the item name can not be overridden with [item-name] either).
Expected behavior
Placeable Item/Recipe should use entity prototype override for its name and description (description already works).
Details
Example mod is: https://mods.factorio.com/mod/er-stockpile
I have an group of dynamically generated entities all placeable_by the same item (shortened code):
Code: Select all
local entity = {
type = "container", name = name,
this.localised_name = {'er.stockpile-name',lsize,ltype,log_mode}
this.localised_description = {'er.stockpile-description'}
}
local item = {
type = "item", name = name,
place_result = name,
this.localised_name = nil,
this.localised_description = nil,
}
Code: Select all
[er]
stockpile-name=__1__ __2__Stockpile__3__
stockpile-description=Just some empty space...
Which leads to the weird situation that i have to specify the name of the item/recipe as *entity name* in the locale files:
Code: Select all
[entity-name] <--used only for item names here
er:stockpile-medium=Medium Stockpile
er:stockpile-large=Large Stockpile
er:stockpile-huge=Huge Stockpile