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."

1 Answer 1

3

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."
4
  • It works but.... Why double quotes? :/
    – Apeiron
    Commented May 5, 2017 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
    Commented May 5, 2017 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
    Commented Mar 9, 2018 at 8:29
  • No. What you use inside __() should have single quotes.
    – Marius
    Commented Mar 9, 2018 at 8:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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