In the mod, I display a list of items in a GUI. The localized names of the items are shown as their names. I determine the localized names using the following code, based on the items’ internal names contained in a table generated by the mod:
Code: Select all
local myLocalName = prototypes.item[myTable[i].name].localised_nameCode: Select all
my_gui_table.add{type = 'label', caption = myLocalName, style = 'bold_label'}Now, as part of the updates for Factorio version 2.1, I want to add a sorting function to the list of items in the mod. So I took the variable described above, which contains the supposed localized names of the items, and wanted to add the localized names to the table so I could sort by them. However, the localized names aren’t being added to the table. When I try to print the contents of the variable to the console using the following code, it outputs “table.”
Code: Select all
myPlayer.print(tostring(myLocalName))
