localized_name -> plain string [seems very simple]
Posted: Thu Jan 25, 2018 7:04 am
Please if possible expose function for converting localized_name to plain string.
I found no way to do it. (I was looking at API - http://lua-api.factorio.com/latest/Conc ... isedString - there is no way to do it described stated there).
The problem obvously isn't limited to non-english users because even in english display name often differs from internal name.
Use case:
filtering technologies by it's displayed name.
for name, tech in pairs(player.force.technologies) do
...
if not matches(tech.research_unit_ingredients, "name", t) and
(
not global.text_filter
or global.text_filter == ""
or tech.name and string.find(string.lower(tech.name), string.lower(global.text_filter), 1, true)
or name and string.find(string.lower(name), string.lower(global.text_filter), 1, true)
-- or tech.localized_name and string.find(string.lower(tech.localized_name), string.lower(global.text_filter), 1, true)
)
Mods wishing to have this are:
- Auto research
- Reseach queue
I found no way to do it. (I was looking at API - http://lua-api.factorio.com/latest/Conc ... isedString - there is no way to do it described stated there).
The problem obvously isn't limited to non-english users because even in english display name often differs from internal name.
Use case:
filtering technologies by it's displayed name.
for name, tech in pairs(player.force.technologies) do
...
if not matches(tech.research_unit_ingredients, "name", t) and
(
not global.text_filter
or global.text_filter == ""
or tech.name and string.find(string.lower(tech.name), string.lower(global.text_filter), 1, true)
or name and string.find(string.lower(name), string.lower(global.text_filter), 1, true)
-- or tech.localized_name and string.find(string.lower(tech.localized_name), string.lower(global.text_filter), 1, true)
)
Mods wishing to have this are:
- Auto research
- Reseach queue