Magento uses a system for translating text in the template files using:
$this->__(\'text to be translated.\');
or
Mage::helper(\
Use this is in js file:
Translator.translate('Some phrase');
But to make it work you should define this translation in phtml:
Translator.add('Some phrase', "__('Some phrase'); ?>");