[Rseding] [0.17.66] Item/Recipe localized name of placeable item ignores entity prototype localised_name.

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5202
Joined: Tue Jul 12, 2016 9:03 am
Contact:

[Rseding] [0.17.66] Item/Recipe localized name of placeable item ignores entity prototype localised_name.

Post by eradicator »

What?
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... 
This works fine for the entity-info when hovering the entity with the mouse. But the item/recipe (which do *not* specify localised_name/description) do show "unknown-key:" as their name, however the description for both correctly uses the dynamic description from the entity.

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
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5202
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [0.17.66] Item/Recipe localized name of placeable item ignores entity prototype localised_name.

Post by eradicator »

Broken name, ok description example when removing the [entity-name] block from the locale file:

unknownentityname.png
unknownentityname.png (89.91 KiB) Viewed 1400 times
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Rseding91
Factorio Staff
Factorio Staff
Posts: 12283
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding] [0.17.66] Item/Recipe localized name of placeable item ignores entity prototype localised_name.

Post by Rseding91 »

Thanks for the report. It's now fixed for the next version of 0.17.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”