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

229
Visualizações
query is empty when language is change using setAppLanguage in nextjs

I'm using Nextjs, and when I redirect to a page(pages/search/index), I can get the query in getServerSideProps but when I change the language using setAppLanguage by importing it from next-translate/setLanguage, the search page is reloaded again but the query is empty in getServerSideProps and I request with an empty query inside this page. By the way, the URL is updated from http://localhost:3000/tr/search?q=anything to http://localhost:3000/en/search?q=anything after the language is changed

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

It helped me

const router = useRouter()

const changeLanguage = (lang: string) => async () => {
    await router.push(router.asPath, undefined, {
      locale: lang
    })
}

used it instead of setLanguage

about 4 years ago · Juan Pablo Isaza Relatório
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