Page 1 of 1

Disable browser language detection?

Posted: Wed Mar 01, 2017 5:26 am
by JockePocke
Opencart 2.3.0.2 multistore with multiple languages.
I only want 1 language displayed in the front-end per store. However the browser automatic language detection changes the language to an undesired language. I.e. I have a Swedish site in Swedish language. However if I'm using an "English browser" site will change language to English.

Anyone knows how to change the code to disable the automatic browser language detection?

Re: Disable browser language detection?

Posted: Wed Mar 01, 2017 6:12 pm
by paulfeakins
Sometimes finding the answer to stuff like this can be done by asking the Linux command line in the right way:

Code: Select all

paul@ant$ grep -r -i -E 'detect.*language' .
./catalog/controller/startup/startup.php:			// Try using local to detect the language
./catalog/controller/startup/startup.php:				// Try using language folder to detect the language
./catalog/controller/startup/startup.php:						$detect = strtolower($browser_language);
So to explain the above I just searched the whole codebase for "detect language" and it shows this is done in:
/catalog/controller/startup/startup.php

Re: Disable browser language detection?

Posted: Thu Mar 02, 2017 5:00 am
by JockePocke
Thanks a million for pointing me in the right direction!

Re: Disable browser language detection?

Posted: Fri Aug 24, 2018 2:21 am
by masterross
Hi JockePocke,
Did you able to disable it?
Please share how to.
Auto detection is probably the stupidest "feature"implemented!