Hi,
in my mod, I generate automaticaly a list of item/recipe/entity where only the suffix changes.
For example, let say a list of Chest-[color] from a list of colors that can be edited.
So I ended with Chest-white, Chest-black, Chest-green, etc...
And I want to give a locale name to these chests.
So, if I have the locale string for Chest, is there a way to generate all the needed locale, ie. :
chest-black = Chest of color black
and also
chest-black = Coffre de couleur noire
etc...
so can we generate cfg files from lua ?
or can we put lua into cfg files to automate generation of strings ?
locale automatic generation ?
locale automatic generation ?
My mods on the Factorio Mod Portal
Re: locale automatic generation ?
No you can't generate locale. I put interface request on that a while ago don't remember what happened to it. Feel free to open another one.
In your case, however, I take it that you know all the locale component words. So you could probably use either external programs or factorio's game.write_file() to output cfg and then put that into your mod's folder.
In your case, however, I take it that you know all the locale component words. So you could probably use either external programs or factorio's game.write_file() to output cfg and then put that into your mod's folder.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
Re: locale automatic generation ?
Thanks for your help.
Using game.write_file() write in script-output only, right ? So I would still have to move the file manually and then rerun factorio. That's ok for me, but not for users of the mod... I'd like this to be automatical, depending on the config file the user could write/change.
Using game.write_file() write in script-output only, right ? So I would still have to move the file manually and then rerun factorio. That's ok for me, but not for users of the mod... I'd like this to be automatical, depending on the config file the user could write/change.
My mods on the Factorio Mod Portal
Re: locale automatic generation ?
It would be good if we could 'inherit' existing locale strings. I have the same challenge as you with my Recycling Mod.
Maybe a special character in a name that tells factorio to concatenate locale strings together?
So in your case "Chest+black" would ask factorio to concatenate the locale for 'chest' and the locale for 'black'.
Maybe a special character in a name that tells factorio to concatenate locale strings together?
So in your case "Chest+black" would ask factorio to concatenate the locale for 'chest' and the locale for 'black'.
Re: locale automatic generation ?
I've been given some great advice on this by Mooncat. It is possible using an unpublished property called 'localised_name' to build 'dynamic' locale.
viewtopic.php?f=97&t=26039&p=183183#p183183
viewtopic.php?f=97&t=26039&p=183183#p183183