I am trying to translate and localize strings in the mini cart. It is not working doing it the standard way (csv in i18n).

It seems a different approach is used then standard strings in the code. E.g.

<?= $block->escapeHtml(__('My text ')) ?>

See image.

enter image description here

How can this be translated? Thank you for your input.

  • You can check this answer magento.stackexchange.com/a/121353/32947 – Quan Le Dec 13 '17 at 10:26
  • Your link refers to JS translations, but this is merely a phtml template file. – Ultrazeus Dec 13 '17 at 12:24
  • It's not like phtml template file, it's a KnockoutJs html template file. So you need to use Js translation to translate them. Please try it out. – Quan Le Dec 13 '17 at 14:53
  • This worked flawlessly @QuanLe. Thank you! – Ultrazeus Dec 15 '17 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.