Basically I'm working on a custom code inside a Joomla module and I'm using jQuery Ajax.
Everything's is working great and I also need to use Joomla language variables because it's a multilanguage website but seems like the Ajax files doesn't recognize the Joomla language tag.
I add to my Ajax files this code in the start:
Code: Select all
define( '_JEXEC', 1 );
define( 'JPATH_BASE', '/var/www/');
require_once ( JPATH_BASE. '/includes/defines.php' );
require_once ( JPATH_BASE. '/includes/framework.php' );
$mainframe = JFactory::getApplication('site');
$mainframe->initialise();
$lang = JFactory::getLanguage();
$lang->load('custom',JPATH_ROOT)
Am I missing something?
How to use JText variables and native Joomla language features in external ajax script file?
Thanks so much and best regards!