My component includes a java script file:
$doc->addScript("/components/com_cam/js/cam.js");
I have several client side messages that I'd like to add with language constants, i.e.
<?php echo JText::_('COM_CAM_SEND_LABEL'); ?>
Easy enough in your front end php code like default.php but what about messages inside cam.js
?
Such as my jquery validation:
messages: {
cam: {
required: "Enter a label",
minlength: jQuery.format("At least {0} characters required!"),
maxlength: jQuery.format("Maximum {0} characters allowed!")
}
}
What is the best practice for this?