hi Yash, I must confess I like your requirement
via JavaScript/HTML5 you can get the geolocation of the user (not sure about browser support, this might not work in old IEs)
you can paste the below JS code in your console and you will get the longitude/latitude, the browser will prompt for a "location access required" confirmation alert
after getting lat/long, you will need to call another API (google maps / bing maps or any other) to know where those coordinates are from: developers.google.com/.../map-geolocation
finally you can redirect to your portal URL with the expected language
I would set that in a cookie, asking the user if they want to change the language, so that JS would be better placed in the Tracking Code, the reason for this is because a user might be in India and still prefer to view your website in English (and vice-versa)
function error() {
console.log( 'Unable to retrieve your location');
}
function success(position) {
console.log(position.coords.latitude);
console.log(position.coords.longitude);
}
navigator.geolocation.getCurrentPosition(success, error);
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.