Menu Close
    Hire us Request quote Reading list Switch to dark mode
    lockdownWebkulUp

    Symfony How to Translate Variable in Twig

    In Symfony we can translate strings/ text in controllers and twig.


    In twig we use this


    Previous twig syntax will not work for variables and will show error then how can we translate any variable in twig ? For this we have to use trans as a filter

    . . .
    Subscribe Articles

    Just enter your email below to subscribe and receive weekly updates about the most interesting similar articles.

    You need to accept conditions to receive letters.
    You've Subscribed!

    Share article via

    . . .


    Framework used – Symfony 2.7, Twig Official Doc  & Symfony Official Doc

    . . .

    Comment (1)

    Add Your Comment

  • UVdesk
    nice article!
  • Back to Top
    css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again
    Close