Add to Cart Success Message Translation issue?
-
13-04-2021 - |
Question
<?= $block->escapeHtml(__(
'You added product %1 to the <a href="%2">shopping cart</a>.',
$block->getData('product_name'),
$block->getData('compare_list_url')),
['a']
);
I have a store view of Sweden as default and I want to translate these words in code " You added product to your shopping cart"
For this I have created I18n / sv_SE.csv in my child theme folder
when I run deploy command this sv_SE is not even deployed in pub folder
also I run this command
php -f bin/magento i18n:collect-phrases -o "app/design/frontend/TemplateMonster/TemplateMonster_child/i18n/sv_SE.csv" app/design/frontend/TemplateMonster/TemplateMonster_child
How can I translate this pop up message??
Pop up [![enter image description here][2]][2]
Solution
You need to confirm that that language should be selected Swedish (Sweden)
in
for you store/website at "Admin > stores > configuration > General > Locale Options > Locale" field. Otherwise, Magento will load en_US.csv file. Also, flush the Magento cache after all changes.
Also, try to edit your CSV file in a simple text editor and paste below text in it and try after the cache flush.
"You added %1 to your <a href=""%2"">shopping cart</a>.","tame add %1 to yourssss<a href=""%2"">shopping cart</a>."