How to make website with multi languages?

Asked

Viewed 578 times

0

I developed a site in only one language but now I wanted to put it in several languages to reach audiences from other countries, is a site where I insert a lot of 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 put this site in several languages? What additional knowledge will I need to have besides the ones I already have that are html,css,php and very little javascript!

  • the website is static or dynamic?

  • as I mentioned insert enough information on the site through the backoffice

  • What is backoffice? Would be a synonym for backend?

  • @Guilhermecostamilam Would be a Content Administrator.

  • @dvd I was curious, is there any link? I looked in google but he did not understand me very well

  • @Guilhermecostamilam Know Wordpress? It would be like that administrator of Wordpress content, where vc post, change, delete posts etc.

  • Which backoffice do you use? Or developed your own?

  • I made my own! It’s just a dynamic site where I can post content imagine news but I want the user to be able to put different languages!

Show 3 more comments

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, serves to verify which language used in the browser, this way, I’m using 2 static pages, but you can use it any way you want.

  • Can you explain? I just don’t understand

  • In the example I have my index.html, where I check which language the browser is using, if it is 'en-BR', redirect the page to my page in English ( in the example is called pt-br.html), if not, redirect to the page in English. This is the static way to do it. You can have 2 or more pages and call them according to the language of the user’s browser

  • You understood that I have a page and insert there content, and the translation have to be done automatically since I will not insert in all languages!

  • https://translate.google.com/manager/website/? hl=en

Browser other questions tagged

You are not signed in. Login or sign up in order to post.