we can use magento default translation in javascript as well as jQuery file.
By using following steps, we can add default magento csv file translation to the code:
Step 1:
In phtml file add following code
1 2 3 |
<script type="text/javascript"> Translator.add('unique code','<?php echo Mage::helper('yourmodule')->__('Message that is to be displayed')?>'); </script> |
Step 2:
Now in the js file use the code that you have defined in the phtml file script section:
1 |
Translator.translate('unique code'); |