The string "x has been added to your Wish List. Click here to continue shopping." can be found in the template Magento/Wishlist/view/frontend/templates/messages/addProductSuccessMessage.phtml

But it doesn't the usual pattern

<?php /* @escapeNotVerified */ echo __('Some string you can translate') ?>

What should I write in my csv file?

Below the template file

echo $block
?> has been added to your Wish List. Click <a href="<?php
echo $block
?>">here</a> to continue shopping.

edit 02.09.2019

Since the question was asked, the template file has been updated to be translatable https://github.com/magento/magento2/commit/624173e59cdbb5f4203ce346b1b53637f32672ef#diff-7586a821ac9c752c277b0c4304885b76

2 Answers 2


Usually you would use sprintf to pass in the dynamic details then you can use the formatting string to do translation.


$message = sprintf("%s has been added to your cart.", $product->getName());

Then in your csv you would just include: %s has been added to your cart. And then translate to whatever language you require, keeping the %s.

  • Thanks for your answer. I read in an article that Magento 2 translations were not sprintf compatible. But I'll take your suggestion and override the template file. magento-quickies.alanstorm.com/post/137168044820/…
    – csmarvz
    Jan 21, 2016 at 9:07
  • @csmarvz if you satisfied with the answer, please mark it as accepted.
    – Tailtiu
    Aug 31, 2019 at 10:25

According official documentation about translation in Magento 2 you should create a dictionnary CSV file in your theme folder.


"%1 has been added to your Wish List. Click here to continue shopping.","%1 a été ajouté à votre liste de favoris"

Any PHP file

$messageManager->addSuccessMessage(__('%1 has been added to your Wish List. Click here to continue shopping.', $product->getName()));

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.