Hello,
I have an ESP32 AsyncWebserver Project with WebSocket. Now I will implement a possibility, that the user can change the language of the WebPage. My WebPage files are saved in SPIFFS partition, my idea was to save there also an translation.json file where I hold the different language strings.
I cannot find an elegant way to do that, I hope anyone can help me here.
Sara and Rui, I´m a great fan of your courses and books, and I learned a lot with them. Thanks for that!
Best wishes
Michael
Hi.
I think it’s easier to have multiple files saved in the filesystem. One file for each language. This will result in a different path for each language. For example: http://ESP32-IP-ADDRESS/en for english, http://ESP32-IP-ADDRESS/pt for Portuguese, etc.
When you select a specific language, the web server makes a request for that file with that specific language. Then, the webserver responds with the corresponding file.
There is probably a more elegant way to do this using json files, but I’m not entirely familiar with that.
Regards,
Sara