I was trying to make translation in JS files.
I have tried
- 1
require([ 'jquery', 'jquery/ui', 'mage/translate' ], function($){ $(window).load(function() { alert($.mage.__('Your Message')); }); });
- 2
<?php echo __('Create Backup') ?>
But nothing worked. It's working fine for strings added in php code.