Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. function getLanguage() {
  2. var $langMap = {
  3. en: 'English',
  4. es: 'Spanish'
  5. };
  6. var $lang = $('html').attr('lang');
  7. return '//cdn.datatables.net/plug-ins/1.10.13/i18n/' + $langMap[$lang] + '.json';
  8. }
  9.  
  10. // Build Datatable
  11. $('#example').DataTable({
  12. language: {
  13. url: getLanguage() // works perfectly, but I need to overwrite with a few custom text options
  14. }
  15. });
  16.  
  17. en: {
  18. // Overwrite defaults with this string
  19. "lengthMenu": "Display _MENU_ records per page - custom test",
  20. },
  21. es: {
  22. // Overwrite Spanish defaults with this string
  23. "lengthMenu": "Mostrar _MENU_ registros - algo muy especial...",
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement