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: 170
- Joined: Thu Aug 15, 2013 12:25 pm
- Location: Madrid, Spain
- Pablo
- Posts: 24244
- 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: 170
- 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.