Translate html tag in magento 2
-
14-04-2021 - |
Question
I have a html template with a string that's translated. The translation contains a html a tag. but the tag is printed as text when rendered.
.html file content:
<p>{{trans "footer_link_privacy"}}</p>
en_US.csv content:
"footer_link_privacy", "<a href=""/en/privacy-policy"">Privacy Policy</a>"
Solution
try with
{{trans "footer_link_privacy"|raw}}
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange