1

I am trying to translate a string by using translate.csv located in theme but translation is not working.

Here is my string

"To check your Gift card information, please click <a href="%s">here</a>.","klik <a href="%s">her</a> for at tjekke din gavekortskode."
2

you need to double the double quotes for it to work.
So if you want the text printed as To check your Gift card information, please click <a href="%s">here</a>. you have to add this in the translate file

"To check your Gift card information, please click <a href=""%s"">here</a>.","klik <a href=""%s"">her</a> for at tjekke din gavekortskode."
  • It works but.... Why double quotes? :/ – Apeiron May 5 '17 at 12:20
  • that's how magento parses the csv files. If you need double quotes inside the string you need to add double double quotes. – Marius May 5 '17 at 12:21
  • And this is also the string passed to $this-__("To check your Gift card information, please click <a href=""%s"">here</a>.") is also with double ""? – snh_nl Mar 9 '18 at 8:29
  • No. What you use inside __() should have single quotes. – Marius Mar 9 '18 at 8:42

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.