I wonder if there is a function php or JS that through the visitor's IP could translate the site automatically according to the netizen's country without having to choose the language manually in a select.
Suppose my site was visited by someone from England, so the script would automatically choose the English language of the Lang folder. If it were visited by someone from Italy, the script automatically rotated the Italian language, so visitors from Portugal and Brazil would have the Portuguese language and so on.
I looked for something like this but found nothing about it.
I noticed that in ads ads ads google uses this function, because even if we Brazilians visit a foreign site, the ads adsense displays are from Brazilian campaigns. It is as if it detects the locality of the visitor. And this is what I want, to detect the user's country and create a condition like:
Se localidade do visitante é igual à Brasil ou Portugal
Utilizar idioma português
Se não se localidade do visitante é igual à EUA ou Inglaterra ou Canadá etc
Utilizar idioma inglês
Se não se localidade do visitante é igual à Espanha ou Argentina ou México etc
Utilizar idioma espanhol
e assim por diante ...