How To Use Smarty Text Inside Javascript?

I'm trying to do this

alert ("{__('done')}");

but this is what it prints {$_smarty_tpl->__('done')} instead of done

Use special environment fro translations. E.g.

in smarty

    

in js

alert(_.tr('error_validator_recaptcha'));

I tried this but it didn't work

Use special environment fro translations. E.g.

in smarty

    

in js

alert(_.tr('error_validator_recaptcha'));

I tried this but it didn't work

It works in core and all addons. Looks like you did something wrong

What is _.tr( ?

didn't work either

What is _.tr( ?

It contains all translation required for notifications, error messages, warnings, etc

didn't work either

It is required to examine issue on your server. At first try to delete the var/cache directory manually

I use smarty within javascript strings all the time. But I normially use single quotes.

alert('{__("done")}');

I've never had a problem.