Setting the language of your website based on the user's location is not the best user experience. People travel, people move and not always do they speak the language of the place they're in.
I'm currently living in Germany for a while, and I know next to nothing of German, so it serves nothing showing me your content in German.
The worst offenders are the ones that first load the default (most of the times, in my experience, English) and then reload or re-paint to show me a language I don't understand.
A much better way (and probably easier) is to use the user's browser/system language. That's the language I want to read on 99% of the time. Otherwise, why would I have my machine in that language? And if it's not, I will change it myself.
So if my preferred language is English, it doesn't matter where I am, the content will be delivered in that language and I will understand it.
It's also super easy:
var userLang = navigator.language || navigator.userLanguage;
Thank you. Signed,