Active
Project:
Views turntable
Version:
6.x-1.0
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
26 Mar 2010 at 18:45 UTC
Updated:
30 Mar 2010 at 10:36 UTC
Hi there,
It could be great to be able to change (and translate) the texts on Next/Previous buttons. Here are the changes to do it separately on each view (it could be adding global variables, too, but it's not (still) ):
On views_turntable_style_plugin.inc, when creating the view style options form (line 118), add the following two fields (it should contain translation source text!):
$form['previous_button_text'] = array(
'#type' => 'textfield',
'#title' => t('Previous button\' text'),
'#default_value' => '< Previous',
'#description' => 'The text to show inside \'Previous\' button',
);
$form['next_button_text'] = array(
'#type' => 'textfield',
'#title' => t('Next button\' text'),
'#default_value' => 'Next >',
'#description' => 'The text to show inside \'Next\' button',
);
On views_turntable.module, when passing options to javascript (line 48), add the following two lines (we translate here!):
'previous_button_text' => t($options['previous_button_text']),
'next_button_text' => t($options['next_button_text']),
On , when creating the buttons inside the javascript (line 97), change the text inside the Span's:
this.parent.prepend(
'<li class="turntable-button">'+
'<a nohref class="turntable-prev">'+
'<span>'+viewsTurntableSettings.previous_button_text+'</span></a></li>' +
'<li class="turntable-button">'+
'<a nohref class="turntable-next">'+
'<span>'+viewsTurntableSettings.next_button_text+'</span></a></li>'
);
See you!!
emi
Comments
Comment #1
Scheepers de Bruin commentedSchweeet, I'll also include this in the next release.
s