• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Multiple languages in ESP32 AsyncWebserver

Q&A Forum › Category: ESP32 › Multiple languages in ESP32 AsyncWebserver
0 Vote Up Vote Down
Michael Reisch asked 1 month ago

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

Question Tags: ESP32, Translation, webserver
1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 1 month ago

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

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.