Magento – Translating “Add to Cart” and “Go to Top”

inline-translationslocalisationmagento-1.9

On my Magento website I have 2 buttons (javascript/ajax) that have the text

"Add to Cart"
&
"Go to Top"

These buttons are both in English, and since my website is in Dutch I tried to translate them. In the .CSV files I tried to edit them, but no effect was shown. This while all of my other translations through .CSV files went very well.

Then I tried using Magento's inline translation, but when hovering over the buttons, there is no booklet to click on in order to translate it.

It looks like the pieces of text are somewhere in some javascript file, but I can't seem to find it anywhere. Would anybody perhaps know where I can edit these two buttons text? Thanks!

Best Answer

It might be an issue with hardcoded lines but first try to find the strings in the corresponding phtml files.

You can use template hints under System > Configuration > Developer > Debug (set scope to the website) to see what phtml file the line is in. Then open up that file, probably under app/design/frontend/[package]/[template]/template/path/to/file.phtml and look for the line Add to Cart for example.

Check if it is inside something that looks like

<?php echo $this->('Add to Cart')?>

If so: go to the locale/nl_NL/translate.csv file under app/design/frontend/[package]/[template]/ or create it and add the line

"Add to Cart","Voeg toe aan winkelwagen"
"Go to Top","Ga naar boven"

If it's not wrapped in the above code you can do so yourself. This will tell Magento to translate it

Related Topic