Home > database >  Change website language using JSON, HTML, and JavaScript
Change website language using JSON, HTML, and JavaScript

Time:09-05

I have created a simple portfolio for myself which is currently in English. I also want to have it in German and other languages. To this end, I have an dropdown option box with the respective language. What I want to do is, once a language is selected, a javascript EventListener will notice this and change the language of the website to that language. I have a en.json and de.json file with the respective class name of the text and the text itself.

The dropdown option menu:

<select id="language" >
                        <option>           
  • Related