Translating Javascript Strings

Updated . Posted . Visible to the public.

Use this syntax:

Translator.translate('Some phrase');

I believe you also have to make the translation available to the Translate class in this manner:

<script type="text/javascript">
Translator.add('You should take care of this confirmation message!','<?php echo Mage::helper('yourmodule')->__('You should take care of this confirmation message!')?>');
</script>

Mike Whitby
Last edit
Posted by Mike Whitby to Magento (2012-10-19 11:27)