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’m not a code expert or any of that kind, but can get most of the code work done with some help. So I end up here asking if there are apps or maybe even an easier way to add script to my code that will automatically redirect users to their own language page. In this case redirecting dutch users to the dutch page.
I’d like to hear if you guys know a solution for this function.
It can detect your visitors’ locations by IP and auto direct them to correct website URLs based on their locations. For example, if your visitor is in Netherlands, and he goes to exampleshop.com, it will auto direct him to exampleshop.com?lang=Dutch. You can easily set up redirecting rules within a few steps. No code is necessary. The service will generate the Javascript code for you to add to your website. Shopify platform is perfectly supported.
I also use a translation app, LangShop, and it has redirects feature. It can redirect visitors based on store language, visitor’s browser language or visitor’s country. Or it’s also possible to suggest language with a popup, also a great thing.
awesome, that’s exactly what I was looking for! Can you help me adapt it ?
I have my website in English and French. I want it to be in french when browser is set in french, and English in any other case.
Thank you so much for your time!
So to get it work for your domain and language, it should work by doing as explained before
Copy the following script (check my answer before, just copy the tags and code between) to your theme.liquid folder in section
From the script, find the supported languages variable, and update it to equal your supported language (so in your case, just replace line const SUPPORTED_LANGUAGES = [“fi”] to const SUPPORTED_LANGUAGES = [“fr”])
One more question, if I have two other languages “fr” and “de”, and same as before, I want the default to be english but french or german depending on browser language. How does the code go ?
Should I use semi-column ?
SUPPORTED_LANGUAGES = [“fr”;“de”] ?
Many thanks again
Is it also possible to customize the code so that people with e.g. French or Italian browser language are also redirected to the English page? Unfortunately, the current situation is that only people with English as their browser language are redirected to the English website. But because we only have English (domain.com/en) and German (domain.com) as languages, we would prefer that people with other languages are also redirected to the English page.
I recommend in this situation to change your site default language to English. I also did it even if my prime market is Finland. So then your german browsers is redirected to domain.com/ge and other languages to domain.com which should be english
It works technically, but not sure this solution complies with EU regulations. I don’t think it is ok to set a cookie or auto redirect without a user’s consent.
Does anyone have more info on this?
Hi i have in my store 2 languages. The DEFAULT is greek and secondary english. I want whoever connects from Greece to do it in Greek and all other countries to be in English. How can I do it?