Change the language
Change the language
reyur
Posts: 3Questions: 0Answers: 0
Hello.
I'm a newbie and I want to change the datatable language.
I have this function :
[code]
$(document).ready(function() {
$('#example').dataTable( {
"oLanguage": {
"oPaginate": {
"sFirst": "Première page",
"sLast": "Dernière page",
"sNext": "Page suivante",
"sPrevious": "Page précédente"
}
}
} );
} );
[/code]
But, how to use it ?
Thank you.
I'm a newbie and I want to change the datatable language.
I have this function :
[code]
$(document).ready(function() {
$('#example').dataTable( {
"oLanguage": {
"oPaginate": {
"sFirst": "Première page",
"sLast": "Dernière page",
"sNext": "Page suivante",
"sPrevious": "Page précédente"
}
}
} );
} );
[/code]
But, how to use it ?
Thank you.
This discussion has been closed.
Replies
Allan
I tried that, but I have an error message :
[quote]DataTables warning (table id = 'personsdt'): Cannot reinitialise DataTable.
To retrieve the DataTables object for this table, please pass either no arguments to the dataTable() function, or set bRetrieve to true. Alternatively, to destory the old table and create a new one, set bDestroy to true (note that a lot of changes to the configuration can be made through the API which is usually much faster)[/quote]
Can you help me please.
It would be very helpful if you could link me to a test page showing the issue so I can say exactly what is going wrong: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read
Allan
I found the solution !
I changed the version of Tapestry5-jquery 3.3.0 to 3.3.6 and the language is French by default!
Thank you.
This is my code :
.tml
[code]
JQuery DataTables
${message:javascript_required}
[/code]
.java
[code]
/**
* Start page of application test.
*/
@Import(stylesheet = { "context:css/jquerydatatables.css" }, library={"context:js/language.js"})
public class Index
{
@Inject
private Messages messages;
@Property
@Persist
private List persons;
@Property
@Persist
Person person;
@OnEvent(value = EventConstants.ACTIVATE)
void init() {
persons = new ArrayList();
Person person1 = new Person();
person1.setNom("aa");
person1.setPrenom("aa");
Person person2 = new Person();
person2.setNom("bb");
person2.setPrenom("bb");
persons.add(person1);
persons.add(person2);
}
public JSONObject getOptions() {
JSONObject options = new JSONObject();
options.put("bJQueryUI", "true");
return options;
}
}
[/code]
I don't understand...
Thank you for your help.
Reyur.