I'm using an external ajax file to perfom an ajax call inside a module.( i didnt want to edit controller or make a subcontroller just for one call )
jQuery(document).ready(function($){
$(document).on('click', '.changeBtn',function(){
var yo="<?php echo 'ip_searchmod_'.$unique_qsid; ?>";
var text="<?php echo JText:: _('COM_IPROPERTY_THANASIS_ADV_SEARCH');?>";
$.ajax({
type:"POST",
url:"/templates/spiti360/html/mod_ip_homesearch/ajaxChangeSimple.php",
success: function(response){
$('#' + yo).html(response);
$('#' + yo).addClass('formSwapper');
$('#top_search_form').addClass('divConSwapper');
$('#swapper').addClass('simpleBtn');
$('#swapper').removeClass('changeBtn');
$('#swapper').text(text);
}
});
});
});
Ajax is working peftectly , my problem is that im using this JText:: _('COM_IPROPERTY_THANASIS_FOR_SALE');
inside the ajax file and it is echoed like : COM_IPROPERTY_THANASIS_FOR_SALE
instead of For Sale
.
On the default.php
file of module that language definition is working perfectly but not inside ajax file.
I tried to use language override from joomla administrator but it didnt work.
Inside ajax file i use the following includes:
require_once( JPATH_BASE . DS . 'includes' . DS . 'defines.php' );
require_once( JPATH_BASE . DS . 'includes' . DS . 'framework.php' );
require_once( JPATH_BASE . DS . 'libraries' . DS . 'joomla' . DS . 'factory.php' );
Do i have to include anything more for it to work ?