I'm developing a module, in my template (MyModule/tmpl/default.php) I'm able to bring my language string to my script by doing this :
<script type="text/javascript">
Mymodule.options.mydz = {
DefaultMessage: "<?php echo JText::_('MOD_MYMODULE_DEFAULT_MESSAGE');?>" };
</script>
I'm wondering if I could call my text with Javascript and without MooTools. I found this :
<script type="text/javascript">
Mymodule.options.mydz = {
DefaultMessage: (Joomla.JText._('MOD_MYMODULE_DEFAULT_MESSAGE'))
};
</script>
But instead of showing my text the browser return "undefined"... I don't know if it still applies, but I read that's because Joomla.JText._ is a function who needs MooTools.
Should I keep showing text via PHP or there is a better way of using multi-language?