I need to figure out whether I use the html in Magento 2 translation dictionaries For example I have this translation dictionaries file in which there are many relevant messages


For instance if I want to use some html like let say I want to bold some word in the predefined message. Can I use the html translation dictionaries file if yes then how I use it and if no then tell me the other way to do html related changes to translation dictionaries messages?

I already use some of the Html tags in translation dictionaries file but it's not working

Any help, experience and knowledge sharing would be appreciated.


I think it is not possible because translation dictionary is not intended for Hypertext Markup formatting. As translation dictionary is a comma separated value (.csv) file used only to localize Magento storefronts.
So there is no way to use it to for text element formatting.

  • 1
    Thanks for your answer but it is not as simple as you think. if that is the case then how do anchor tag use in this translation file like <a href=""%1"">click here</a> ? check magento 2 core file \vendor\magento\module-advanced-checkout\i18n\en_US.csv for reference. – Muhammad Hasham Apr 9 '19 at 5:50
  • sorry mate can't check it right now I'm only using mobile. but I think they are generated because they are as theme strings – fmsthird Apr 9 '19 at 6:04
  • can you check from here devdocs.magento.com/guides/v2.3/frontend-dev-guide/translations/… – fmsthird Apr 9 '19 at 6:06
  • 1
    I already checked this, this is for how we can use theme strings in phtml file. I still feel there is way to do some html related changes to translation dictionaries messages whether you made changes in csv or other way – Muhammad Hasham Apr 9 '19 at 6:09
  • 1
    That is not completely what I looking for. I need a way to do html related changes to translation related message because some of the tutorial suggested me to made changes in csv file. if you said it is not possible I can accept your claim because I don't have much research on this one but tell me other way to do html related changes to translation dictionaries messages (as I mentioned in my question). Still for your effort. +1 – Muhammad Hasham Apr 9 '19 at 6:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.