Looking for: Bilangual automatic redirect app (impulse theme)

VAIN
Tourist
11 0 5

Dear Community,

 

I'm currently making my store bilangual (Dutch/English) and I'm doing this with the Translation Lab app from Sherpas Design. They are currently still developing an automatic store language redirect and told me to use another app in the meantime.

 

I've been trying several apps and plugins but nothing seems to work so far.

 

So what I have is an english website with a dutch translation with the following url's.

English url: https://vain.store

Dutch url: https://vain.store/nl

 

What should happend is that when someone located in the netherlands visits the english url, he gets redirected to the dutch translation. But I cant happend to find an app that fulffills this function for me.

 

Does anyone have experience with this or may have a solution?

I'd really like to hear!

 

Greetings,

Ewald

0 Likes
VAIN
Tourist
11 0 5

Hi Lixon_Louis,

 

I do have tried this application, but it does not have an automatic redirect function for when you load the page.

0 Likes
Lixon_Louis
Shopify Partner
1186 35 253

Try https://members.ip-api.com/ . It allows 45 requests/min on a free plan. you could get the country code via Ajax and redirect based on it. Here is the logic.

 

$.getJSON('https://ipapi.co/json/', function(data) {
  console.log(JSON.stringify(data.country_code));
if(data.country_code == 'NL'){
 window.location.href= 'https://vain.store/nl'
}
});

 

 

 

VAIN
Tourist
11 0 5

Thanks for the reply, I'll try this!

0 Likes
MichaelGeo
Pathfinder
191 3 14

Hi, you may potentially use Geo Redirect tool. It can detect your visitors' geolocation by IP and auto direct them to correct website URLs seamlessly based on visitor locations. The accuracy at country level is over 90%. For example, if your visitor is in Netherlands, and he goes to exampleshop.com, it will auto direct him to exampleshop.com/nl.

 

The tool is easy to set and integrate within a few steps. No code is necessary by yourself. The service will generate the JavaScript code for you to add to your website. Shopify platform is perfectly supported.

 

Hope it helps!

0 Likes
VAIN
Tourist
11 0 5

Thanks, for the help we made it work with a cookie that redirects to the /nl website, this way we got it working in a desired way.

 

Here's the code:

 

 
if (getCookie("language") == "") { 
  $.getJSON('https://ipapi.co/json/', function(data) {
    if(data.country_code == 'NL') {
      document.cookie = "language=NL;";
      if (!window.location.href.includes('https://vain.store/nl')){
        var url = window.location.href;
        
        
        var txt2 = url.slice(0, 19) + "nl/" + url.slice(19);
    window.location.href= txt2;
      }
  }
});
 
}

 

 

0 Likes