Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

122
Views
Setting default language for PHP multilingual website

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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!