How to make website with multi languages? [duplicate]

0

I developed a site in just one language but now I wanted to get it in several languages to reach audiences from other countries, it's a site where I insert enough information in my backoffice that will be shown to my target audience.

What I want to know is what would be the best way to get this site in different languages? What additional knowledge will I need to have besides what I already have that are html, css, php and very little javascript!

    
asked by anonymous 08.07.2018 / 21:35

1 answer

1

A simple way to do this would be with JS

example:

var userLang = navigator.language || navigator.userLanguage; 
        console.log("The language is: " + userLang);
        if (userLang == 'pt-BR') {
            var novaURL = "pt-br.html";
            $(window.document.location).attr('href',novaURL);
        }
        else {
            var novaURL = "english.html";
            $(window.document.location).attr('href',novaURL);
        }

navigator.language or navigator.userLanguage, check the language used in the browser, so I'm using 2 static pages, but you can use it any way you want.

    
08.07.2018 / 23:07