Translator.translate('Some Text to Translate');
It is the same for all Magento version. The difference is in how we declare the text.
In Magento 1.5 and 1.6, you need to declare the text somewhere in your html file, like below:
Translator.add('Some Text to Translate', '__('Some Text to Translate')?>');
With Magento 1.7++, it won't work. In Magento 1.7++, you need to add a jstranslator.xml file in your etc folder (app/code/local/[Your_Namespace]/[Module_Name]/etc). This file looks like:
<[un-identifiant-unique] translate="message" module="[monmodule]"> Some Text to Translate[un-identifiant-unique]>
Well, that's all. I think it's really easy and you can try it yourself. Happy to answer any question and comment!