Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

128
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda