0

I've successfully implemented the Angular DataTable in my application. The only problem is that I can't figure out how to configure my own language settings for the datatable. The only threads who covers this topic is in AngularJS.

datatable image

E.g. "Show X entries" -> "Viser X rader", "Search" -> "Søk", "Previous" -> "Forrige", etc ...

Any suggestions will be highly appreciated.

Mathis Garberg
  • 425
  • 2
  • 7
  • 15

1 Answers1

2

Thanks to davidkonrad and this answer, I finally figured it out.

export const norwegian = {
  'emptyTable': 'Ingen data tilgjengelig i tabellen',
  'info': 'Viser side _PAGE_ av _PAGES_',
  'infoEmpty': 'Viser 0 til 0 av 0 linjer',
  'infoFiltered': '(filtrert fra _MAX_ totalt antall linjer)',
  'infoPostFix': '',
  'infoThousands': ' ',
  'loadingRecords': 'Laster...',
  'lengthMenu': 'Viser _MENU_ rader',
  'processing': 'Laster...',
  'search': 'Søk:',
  'url': '',
  'zeroRecords': 'Ingen rader matcher søket',
  'paginate': {
    'first': '««',
    'previous': '«',
    'next': '»',
    'last': '»»'
  },
  'aria': {
    'sortAscending': ': aktiver for å sortere kolonnen stigende',
    'sortDescending': ': aktiver for å sortere kolonnen synkende'
  }
};

Import the file in your component and set the dtOptions like this:

this.dtOptions = {
      pagingType: 'full_numbers',
      language: norwegian
    };
Mathis Garberg
  • 425
  • 2
  • 7
  • 15