Magento2: Magento 2 translation issue: notification Added to shopping cart

Created on 16 Oct 2018  路  6Comments  路  Source: magento/magento2

Can see that Magento 2.2.6 is created new folder to vendor/magento/module-checkout/view/frontend/templates/messages and file addCartSuccessMessage.phtml
File is added this notification " You added "product name" to your shopping cart." with link text "shopping cart". It is anything quick fix to this issue that translation works?

Preconditions (*)

  1. PHP 7.1
  2. Magento 2.2.6

Steps to reproduce (*)

  1. Add product to shopping cart
  2. Notification: You added "product name" to your shopping cart.

Expected result (*)

  1. Translation doesn't change notification to another language

Actual result (*)

  1. It should be translate this notification to another language.
    notification

Tested translations:
tested

Format is valid

Most helpful comment

You're CSV columns are enclosed in double quotes, but you don't appear to be escaping the double quotes of the href attribute. Have you tried:

"You added %1 to your <a href=""%2"">shopping cart</a>.","Lis盲sit %s <a href=""%2"">ostoskoriisi</a>."

All 6 comments

Hi @Userr017. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [ ] Summary of the issue
  • [ ] Information on your environment
  • [ ] Steps to reproduce
  • [ ] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop).
For more details, please, review the Magento Contributor Assistant documentation.

@Userr017 do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [ ] yes
  • [ ] no

You're CSV columns are enclosed in double quotes, but you don't appear to be escaping the double quotes of the href attribute. Have you tried:

"You added %1 to your <a href=""%2"">shopping cart</a>.","Lis盲sit %s <a href=""%2"">ostoskoriisi</a>."

Thanks it works!

"You added %1 to your shopping cart.","Lis盲sit %1 ostoskoriisi."

It's not a bug. It's a feature.

https://github.com/magento/magento2/commit/c1c1f634f2d853592fed934b66306fa588c0e10f#diff-96438fe541523232e8bf703fe4b1eb74

There are 2 different lines that can be generated by successful add to cart action now:

"You added %1 to your shopping cart."
"You added %1 to your <a href=""%2"">shopping cart</a>."

I also couldn't find the translation "You added %1 to your shopping cart.", because it is not yet included in /vendor/magento/module-checkout/i18n/en_US.csv

This is still an issue in Magento 2.3.3. @pocallaghan solution solved it!

Was this page helpful?
0 / 5 - 0 ratings