Localisation in log files
Posted: Thu Jan 03, 2019 2:39 pm
Hello!
I'm working on a fun pet project that allows for traversing items and recipes via a web interface, with the ultimate goal being you can load in whatever mods you are using and create a dump of the information I need from items and recipes to a log file from within factorio. I take that data and upload it to my site, parse it, and make a snazzy GUI that can show you how to make whatever item, what assembling machine it takes, recipe info, etc. For a days work, it works pretty well but I'm not near ready enough to post it anywhere. But I did come across one problem...
The LuaEntityPrototype class "localisation_name" (and similarly in LuaRecipePrototype) does not contain any useful information. I'd love to be able to pull the localisation out so I don't have to copy and paste from a ton of .cfg files and build my localisations that way. It seems... unreliable doing it that way.
Recommendation:
Add localisation_names to Lua*Prototype objects to contain a key/value pair of "language" to "definition"...
CODE: SELECT ALL
(pardon me if this incorrect syntax but it's late and I'm very tired )
with that I'd be able to pull the language(s) that I want to include for a given item, recipe, tile, etc
Similarly, if I'm missing something please feel free to let me know if this possible and I've missed it.
I'm working on a fun pet project that allows for traversing items and recipes via a web interface, with the ultimate goal being you can load in whatever mods you are using and create a dump of the information I need from items and recipes to a log file from within factorio. I take that data and upload it to my site, parse it, and make a snazzy GUI that can show you how to make whatever item, what assembling machine it takes, recipe info, etc. For a days work, it works pretty well but I'm not near ready enough to post it anywhere. But I did come across one problem...
The LuaEntityPrototype class "localisation_name" (and similarly in LuaRecipePrototype) does not contain any useful information. I'd love to be able to pull the localisation out so I don't have to copy and paste from a ton of .cfg files and build my localisations that way. It seems... unreliable doing it that way.
Recommendation:
Add localisation_names to Lua*Prototype objects to contain a key/value pair of "language" to "definition"...
CODE: SELECT ALL
Code: Select all
game.entity_prototypes[x].localisation_names = { "en" : "Foo", "de" : "Bar", "ga-IE" : "Bash" } etc
with that I'd be able to pull the language(s) that I want to include for a given item, recipe, tile, etc
Similarly, if I'm missing something please feel free to let me know if this possible and I've missed it.