1

I want to translate KO text.

"You have no items in your shopping cart."  "Empty Basket" 

Already tried with translate.csv it doesn't work.

Is there any way to translating knockout template text in magento2?

Black
  • 3,310
  • 4
  • 31
  • 110
Sanju
  • 555
  • 3
  • 13

2 Answers2

0

You Can try this its work for me.

find pub/static -name js-translation.json

Add your translation in theme js-translation.json

For Example:

{"You have no items in your shopping cart.":"Empty Basket"}
{"Forgot Your Password?":"Forgot Password?"}

Once that's done we clear the cache:

php bin/magento cache:clean
php bin/magento cache:flush
Black
  • 3,310
  • 4
  • 31
  • 110
0

Try following code

<!-- ko i18n: 'You have no items in your shopping cart."  "Empty Basket' --><!-- /ko -->

Translate it into i18n directory of your module. & last thing is make deploy.

 rm -rf pub/static/frontend
 php -dmemory_limit=1G bin/magento setup:static-content:deploy -f
 chmod 777 -R var/ pub/static generated/
MR.R DNATH
  • 462
  • 2
  • 10