I've started working on an existing PHP website and previous developers used cookies to set languages, I'm not familiar with this approach since I prefer to use explicit routing.
So my concern is I want to set a default language for the visitors in their first visit. What I know about cookies that they will set the language based on the browser of the user, but the website is always showing one language (langA) regardless of the browser settings. And I want langB to be the default one.
Sample of Translate Javascript:
var webContentVar = {
"header-translate":{
"langA":{
"home":"1",
"about":"2,
},
"langB":{
"home":"11",
"about":"22",
},
},
}
Unfortunately I don't know how this works, but I've seen someone talking about the same approach here:
https://stackoverflow.com/a/2400221/10773318
Thank you in advance.