Is it possible to do localisation dynamical?
Posted: Tue Feb 06, 2018 5:17 am
I am working on a mod that has a few Items with a configurable number of tiers. Is it possible to do the localisation dynamical or set the screen name is Code?
www.factorio.com
https://test.forums.factorio.com/
Code: Select all
localised_name = {"some_group.some_localisation_identifier", some_variable}
Code: Select all
-- Generates a barrel item with the provided name and fluid definition using the provided empty barrel stack size
local function create_barrel_item(name, fluid, empty_barrel_item)
local result =
{
type = "item",
name = name,
localised_name = {"item-name.filled-barrel", {"fluid-name." .. fluid.name}},
icons = generate_barrel_item_icons(fluid, empty_barrel_item),
icon_size = 32,
flags = {"goes-to-main-inventory"},
subgroup = "fill-barrel",
order = "b[" .. name .. "]",
stack_size = empty_barrel_item.stack_size
}
data:extend({result})
return result
end
Code: Select all
[some_group]
some_localisation_identifier=SomeItemName Tier __1__
Code: Select all
[item-name]
thing=Thing
thing-1=__ITEM__thing__ 1
thing-2=__ITEM__thing__ 2