Export a separate json file with your game


#1

Hello guys, I am looking for a way to export a json file (containing text used in the game) with the rest of the project, so that the json is placed in the game folder once the game is installed by the user.
It could be used for localization, since I would only have to translate the json containing all my game text and not have to modify everything in Gdevelop.
As of now I have tried manually adding the json to the folder containing the export, before building it with electron, but it hasn’t been successful.
The only topics I’ve found regarding the “load json” action are from people who create the json in the game before accessing it, therefore they do not need to export it like I do.
The closest situation I’ve found is this one : Help/info text screen but it hasn’t been solved since 2019.
(there is also this one but it’s even older : How to add game text in seperate json file and retrive them)
There is also this workaround but it’s a bit weird… [TUTORIAL] Read data from an external .JSON file

Any help will be greatly appreciated :pray:


Help/info text screen
#2

I dont know is the question is the export /import part, is the .json part or is the logic part with the different languages.

basically if you create the .JSON (exported from the game os by hand), just copy it to the game folder where the game will search it.
when you packing, choose the .zip option in GDevelop. unzip and copy your files to the desired folder. in my poinion, you should just zip it back and done. GD games doesn’t require any special “installation”, but if you insist to it I bet you can find a third party solution to create a windows installer file.


#3

I didn’t quite understand the answer that you provided, but I have finally found a workaround by messing with the Electron export settings.
If you’re interested in exporting a .json with your game executable, let me know, I will try to explain.