Hi Pablo / everyone,
I’m building a website with WYSIWYG Web Builder and I’d like to implement multilingual support (for example: Spanish/English) in a maintainable way.
My goal is:
* Design pages normally in WWB.
* Avoid hardcoding visible text directly in each element.
* Load texts from external JSON files (one file per language, e.g. es.json, en.json).
* Switch language with a button/dropdown.
* Keep selected language in localStorage (or similar), so it persists between visits.[/list]
I’m considering using data-i18n attributes in elements and a JavaScript function that fetches the selected JSON and replaces element text at runtime.
I know there are extensions that can help with multilingual websites, but I’d specifically like to understand and use this JSON-based approach.
Could you confirm if this is a recommended method in WWB?
If yes, what is the cleanest way to integrate it in WWB projects (layout grids, forms, menus, extensions)?
Also, are there known limitations when using this method?
Thanks in advance!
Load texts from external JSON files
Forum rules
IMPORTANT NOTE!!
DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
IMPORTANT NOTE!!
DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
- miguelss
-

- Posts: 171
- Joined: Thu Aug 15, 2013 12:25 pm
- Location: Madrid, Spain
- Pablo
- Posts: 24246
- Joined: Sun Mar 28, 2004 12:00 pm
- Location: Europe
- Contact:
Re: Load texts from external JSON files
I have no experience with this approach so I cannot tell if this will work, but you can try.
Unfortunately I cannot help with the implementation of this because for me it would also take several horus to figure this out.
Unfortunately I cannot help with the implementation of this because for me it would also take several horus to figure this out.
- miguelss
-

- Posts: 171
- Joined: Thu Aug 15, 2013 12:25 pm
- Location: Madrid, Spain
Re: Load texts from external JSON files
Thank you for your reply, Pablo.
I think it's possible.
How?
If the website is already finished, we need to extract the unique IDs of the text, labels, etc. and publish them in a JSON file (e.g. de.json for the German language).
Then I need to create a selector with /index.html?lang=de
and include a script in the end of the body for that purpose.
I will come back with an example!
Cheers,
M.
I think it's possible.
How?
If the website is already finished, we need to extract the unique IDs of the text, labels, etc. and publish them in a JSON file (e.g. de.json for the German language).
Then I need to create a selector with /index.html?lang=de
and include a script in the end of the body for that purpose.
I will come back with an example!
Cheers,
M.
- wwonderfull
-

- Posts: 1646
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Load texts from external JSON files
The solution you have mentioned @miguelss is more like a custom scripted solution not the most professional way but it's like a swap and replace. It works for basic site or web apps but for professional website which have multilingual pages the best way is using hreflang which pablo has already implemented. In the <head> of each page, add <link rel="alternate" hreflang="es" href="https://example.com/es/">. This tells Google which version to serve to which audience. Each language version should have its own dedicated URL (e.g. example.com/en/, example.com/es/). Search engines index these separately, so users searching in Spanish will see the Spanish page. Proper hreflang and canonical tags prevent search engines from penalizing you for having similar content across languages. Hard work but that's how it is done professionally.
Instead of swapping text at runtime with JavaScript, professionals generate the translated HTML directly. This ensures crawlers see the translated text without relying on client‑side scripts. So if your target is only for you and your audience to swap and replace and see that is fine but the search engine will not give any benefits for it. The SEO way of doing it is hreflang.
The one you had mentioned there are already so many scripts to do it. But as I have said it is not the way wwb handles translating pages. It is a way you have to implement this custom way in wwb in your own way carefully although not recommended.
https://stackoverflow.com/questions/736 ... javascript
Instead of swapping text at runtime with JavaScript, professionals generate the translated HTML directly. This ensures crawlers see the translated text without relying on client‑side scripts. So if your target is only for you and your audience to swap and replace and see that is fine but the search engine will not give any benefits for it. The SEO way of doing it is hreflang.
The one you had mentioned there are already so many scripts to do it. But as I have said it is not the way wwb handles translating pages. It is a way you have to implement this custom way in wwb in your own way carefully although not recommended.
https://stackoverflow.com/questions/736 ... javascript
- miguelss
-

- Posts: 171
- Joined: Thu Aug 15, 2013 12:25 pm
- Location: Madrid, Spain
Re: Load texts from external JSON files
Hi wwonderfull,
Thank you so much for taking the time to explain everything to me. I genuinely appreciate the effort you put into helping me understand why my original direction wasn’t the most suitable one. Your explanation was not only clear but also incredibly detailed, and that really made a difference. It helped me step back, rethink my idea, and see things from a much better perspective.
I know it takes time and patience to break things down the way you did, and I truly value that. Your message has given me a lot to reflect on, and it’s already helping me reshape my approach in a more solid and thoughtful way. Thanks again — your help really meant a lot to me.
M.
Thank you so much for taking the time to explain everything to me. I genuinely appreciate the effort you put into helping me understand why my original direction wasn’t the most suitable one. Your explanation was not only clear but also incredibly detailed, and that really made a difference. It helped me step back, rethink my idea, and see things from a much better perspective.
I know it takes time and patience to break things down the way you did, and I truly value that. Your message has given me a lot to reflect on, and it’s already helping me reshape my approach in a more solid and thoughtful way. Thanks again — your help really meant a lot to me.
M.
- wwonderfull
-

- Posts: 1646
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Load texts from external JSON files
Thanks, Welcome anytime : )