Support Forums

Support Online : Mon - Fri / 10am - 6pm (GMT +6)

Your Time: Our Time:

translate

Featured Lock Resolved Issue
Hy,
YOU HAVE ALREADY RATED THIS ENTRY! <-- Constant for overrides?
it is rather sad that it is done so that it is impossible to translate

1 Answers

Ok!

Translate only in main.js
But if multilanguage:

cut this section from main.js :


// Article Ajax voting
$(document).on('click', '.sp-rating .star', function (event) {
event.preventDefault();

var data = {
'action': 'voting',
'user_rating': $(this).data('number'),
'id': $(this).closest('.post_rating').attr('id')
};

var request = {
'option': 'com_ajax',
'plugin': 'helix3',
'data': data,
'format': 'json'
};

$.ajax({
type: 'POST',
data: request,
beforeSend: function () {
$('.post_rating .ajax-loader').show();
},
success: function (response) {
var data = $.parseJSON(response.data);

$('.post_rating .ajax-loader').hide();

if (data.status == 'invalid') {
$('.post_rating .voting-result').text('You have already rated this entry!').fadeIn('fast');
} else if (data.status == 'false') {
$('.post_rating .voting-result').text('Somethings wrong here, try again!').fadeIn('fast');
} else if (data.status == 'true') {
var rate = data.action;
$('.voting-symbol').find('.star').each(function (i) {
if (i < rate) {
$(".star").eq(-(i + 1)).addClass('active');
}
});

$('.post_rating .voting-result').text('Thank You!').fadeIn('fast');
}

},
error: function () {
$('.post_rating .ajax-loader').hide();
$('.post_rating .voting-result').text('Failed to rate, try again!').fadeIn('fast');
}
});
});


and paste in cloned template Custom Javascript textarea
but before add:

jQuery(function($) {


and after:


});


Why clone template? Because if multilanguage it is still healthy if each language has its own template..

(I thought I would describe it because I did not find a normal description anywhere. how to do it) and it may be useful to others... ;)


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Leaderboard (30 days)

Paul Frankowski

Paul Frankowski

Total Accepted Answers: 141
Toufiq

Toufiq

Total Accepted Answers: 48
Shibbir

Shibbir

Total Accepted Answers: 25
Pavel

Pavel

Total Accepted Answers: 4
Rodrigo Corbata

Rodrigo Corbata

Total Accepted Answers: 3

100+

Templates

200,000+

Community Users

Newsletter

Don’t miss any updates of our new templates and extensions and all the astonishing offers we bring for you.
We never spam