Unfortunetaly, the langauge packages are named by language names, not by language codes :
//cdn.datatables.net/plug-ins/1.10.7/i18n/Finnish.json
//cdn.datatables.net/plug-ins/1.10.7/i18n/French.json
etc. So you must built a map that translates language codes to language names :
var langMap = { 'en' : 'English', 'da' : 'Danish', 'se' : 'Swedish' //etc, the languages you want to support }
Now you can pass the correct language package URL to dataTables that corresponds to the current browser language :
function getLanguage() { var lang = navigator.language || navigator.userLanguage; return '//cdn.datatables.net/plug-ins/1.10.7/i18n/'+langMap[lang]+'.json' } var table = $('#example').DataTable({ language : { url: getLanguage() } });
demo -> http://jsfiddle.net/3er6f4w6/