Automatic change of language not working

Hello everyone,
I have a website in french and english with an extension that can detect the visitor ip and display the language (fr, us) and currency (Euro, USD and GBP) accordingly.
Since on Cloudflare, it doesn’t work anymore. It stays on engilsh and GBP.
I connected to the website using a nordvpn account and no matter what, same. Other visitors told me the same.
Is there a way to be able to activate in Cloudflare a kind of geolocation in order to have the visitor’s real IP and do the change?
Thank you for your help!

What is the plugin? There are several ways to do this, and the way to Configure them to work with Cloudflare will differ.

There are probably two things tripping you up here.

  1. You are looking at the wrong IP address in the HTTP request seen by your Origin server. Your Origin will see the address of the Cloudflare servers unless you make a change. You will need to Restore the Visitor IP, which will make your plugin see the actual client IP address. You might also be able to configure your plugin to look at the CF-IPCountry header, which includes the country already.

  2. If the content is cached, each visitor will see the same cached result, regardless of their language. They will see whatever the “first” visitor was given by your Origin server. There are a few ways to shard the cache by country or Accept-Language, depending on what your extension is doing.

1 Like

Hello and thank you for your answer.
Developer of the extension has warned than the extension + Cloudflare should be tricky. Developer is Brontobytes and extension is called Geoip localisation.
The origin server visibly only sees the Cloudflare servers. I saw this Restoring original visitor IPs · Cloudflare Support docs
but is seems rather complex!
The extension doesn’t do much and no configuration possible other than input which country gets what as a language and currency.

I was going to suggest that it isn’t as complex as it looks, but my comfort level with certain tasks definitely influences my perspective. Do you host somewhere that may be able to assist you with restoring visitor IPs?

It is a hosted dedicated server so I’m pretty much my own support :slight_smile:
I’m going to get into that restoring thing and figure it out. I guess I was hoping for a more simple solution :smirk:

Oh, that actually makes it much easier. You should be fine following the guide. If you have questions, you can seek clarification here.

1 Like