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

167
Visualizações
Is there a way to dinamically translate javascript variables in Symfony?

I have a twig variable with a value like:

{{ var | trans }}

Obviously this is working as intended in the HTML when the page loads, but I need to be able to change the variable's value with javaScript dinamically.

Now, I get that twig is executed on the server-side, but I was wondering if there is some workaround to get this translated using Symfony's translator (or other options).

I have learned that you cannot pass variables from PHP to JS using an external file, which I am using, but still, I am not sure if there is no option whatsoever to achieve what I need. Been searching for a while and I know there are more lookalike questions like this one but no answer responded to this specific question.

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