1
    <?= $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

enter image description here

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]

7
  • You can use Inline translation for this. Please try it. Thanks and Happy Coding. May 1, 2020 at 17:20
  • I have tried that and It displays alphabets in an array May 4, 2020 at 9:19
  • which popup do you want to translate?
    – kunj
    May 4, 2020 at 9:21
  • I have added that pop up May 4, 2020 at 9:23
  • What is your Magento version and have you override the Magento checkout module? and is your Magento is in production mode?
    – kunj
    May 4, 2020 at 9:32

1 Answer 1

3
+50

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

9
  • The locale field is Sweden I have already set this May 4, 2020 at 10:21
  • The default theme already have en_US.csv in i18n folder May 4, 2020 at 10:22
  • after creating child theme I uploaded sv_SE.csv in i18n and run deploy can cleared cache but still changes are applied in fact sv_SE is changed to something else and is even not deployed to pub folder May 4, 2020 at 10:24
  • @HafsaZulfiqar oh okay so you added a new theme, you need run setup upgrade first after that setup di compile and after that deploy the content.
    – kunj
    May 4, 2020 at 10:41
  • I am also done with that May 4, 2020 at 10:43

Your Answer

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

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