Internalization of DataTable
Internalization of DataTable
How can I change the language in the table according to the web page language?
Right now my webpage is displayed according to the language select by the user at the beginning (English/Spanish). If I try to initialized the table with oLanguage for Spanish it work but table have Spanish version all the time even when page itself in English version. How can I solve this problem?
Thanks in advance.
Right now my webpage is displayed according to the language select by the user at the beginning (English/Spanish). If I try to initialized the table with oLanguage for Spanish it work but table have Spanish version all the time even when page itself in English version. How can I solve this problem?
Thanks in advance.
This discussion has been closed.
Replies
[code]
if ( page_lang == "es_ES" )
{
lang = { ... Spanish options };
}
else
{
lang = { ... whatever };
}
$('#tableId').dataTable({ "oLanguage": lang });
[/code]
You can also use the same technique to feed it different language file URLs.
Allan