[phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2075: compact(): Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2182: Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2075: compact(): Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2182: Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2075: compact(): Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2182: Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2075: compact(): Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2182: Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2075: compact(): Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2182: Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2075: compact(): Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2182: Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2075: compact(): Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2182: Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2075: compact(): Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2182: Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2075: compact(): Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2182: Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2075: compact(): Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2182: Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2075: compact(): Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2182: Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2075: compact(): Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2182: Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2075: compact(): Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2182: Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2075: compact(): Undefined variable $warn_allowed [phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 2182: Undefined variable $warn_allowed [0.14] Modding - glitch in item localisation - Factorio Forums
[item-name]
X = X item name
[item-description]
X = X item description
[entity-name]
X = X entity name
[entity-description]
X = X entity description
When I hover over the recipe, I see: "X entity name" and "X item description" (I expect "X item name" and "X item description")
When I hover over the item in an inventory or quickbar, I see "X entity name" and "X item description" (I expect "X item name" and "X item description")
If I drop the item on map, when I hover over its item-entity (item-on-ground), I see: "X entity name" and no description (I expect "X item name" and "X item description")
While placing the entity on map, I see "X entity name" and "X entity description" (this is correct)
When hovering placed entity, I see "X entity name" and "X entity description" (this is correct)
Other notes which may or may not be relevant:
1. I tried setting `[recipe-name] X = recipe name` (obvs. with a line feed in there) in locale file - did not have any effect. (I would expect recipe name/description to override item name/description in crafting menu)
2. I tried setting, in the item prototype, `locale_name = { "item-name.X" }` - did not have any effect. (I would expect setting locale_name/locale_description) on any prototype to override the respective locale keys for that prototype, thus allowing re-use of existing translations)
It seems that items default to the name of the entity they create when placed (`place_result`), even if the name of the item is defined. Yet they correctly use item description in preference to entity description.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Item-name is only used if you define the localized_name directly in the prototype or the item has no place result (entity, equipment, or tile).
That's by design since locale keys can't be conditionally used in prototypes. That was the cause of desyncs previously and the above change was the fix.
If you want to get ahold of me I'm almost always on Discord.
Is the same not true of the description, as that seems to work conditionally? (the item-description is shown in crafting screen for example).
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
aubergine18 wrote:Is the same not true of the description, as that seems to work conditionally? (the item-description is shown in crafting screen for example).
item description is always item description. It doesn't show anything else. If the item doesn't have a description none is shown.
When I say "conditionally" I refer to "should it use the item-name locale or the first entity it builds or the first tile it builds or ..." instead of "just use item-name even if it probably doesn't have a locale entry".
If you want to get ahold of me I'm almost always on Discord.
Would it be possible to add `locale_name` property in `item` prototype to set specific locale key to use for item name? This would be static as part of the item definition, so shouldn't cause desync?
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
aubergine18 wrote:Would it be possible to add `locale_name` property in `item` prototype to set specific locale key to use for item name? This would be static as part of the item definition, so shouldn't cause desync?
That's already a thing: localized_name and localized_description.
If you want to get ahold of me I'm almost always on Discord.
Tried them as stated in OP - they didn't seem to work, but will test again.
EDIT: Tested in the item prototype, hoping it would set name based on key `item-name.wood-bridge` but it still showed the text for `entity-name.wood-bridge`:
Last edited by aubergine18 on Sun Oct 09, 2016 8:58 pm, edited 1 time in total.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Posted test results above - didn't work for item prototype.
EDIT: Doh! Just seen what I did wrong - spelling typo. Will try again.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
[recipe-name]
wood-bridge-from = Wooden Bridge
[item-name]
wood-bridge-from = Wooden Bridge
[item-description]
wood-bridge-from = Rickety wooden pedestrian bridge for crossing water.
[entity-name]
wood-bridge-from = Wood Bridge: Set start point
wood-bridge-to = Wood Bridge: Set end point
[entity-description]
wood-bridge-from = Place at waters' edge to start building the wooden bridge.
wood-bridge-to = Place on the opposite shore to complete the wooden bridge.
wood-bridge-cap = Rickety pedestrian bridge.\n\nIt can be removed by mining or destroying this end cap.
Result in game (crafting screen):
It's still showing `entity-name.wood-bridge-from`, despite me having `localized_name = { "item-name.wood-bridge-from" }`.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
I put the locaized_name in to both the item proto and the recipe proto. Neither had any effect either on the crafting screen or items when in quickbar etc.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
ah, I had typo based on what you posted earlier: localized - should be localised (s not z). it's days like this I wish I wasn't partially dyslexic :/
Checking...
Yes, it works! For both item and recipe!
Thank you for your patience!
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.