Created
September 4, 2018 08:48
-
-
Save semiherdogan/fc91fd13ea3091da53bcd3d9b3c93e99 to your computer and use it in GitHub Desktop.
Datatables default config (Turkish)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.extend( true, $.fn.dataTable.defaults, { | |
processing: true, | |
serverSide: true, | |
ajax: { | |
url: '', | |
type: 'POST' | |
}, | |
aLengthMenu: [[15, 25, 50, 75, -1], [15, 25, 50, 75, 'Tümü']], | |
iDisplayLength: 15, | |
lengthChange: true, | |
searching: true, | |
ordering: true, | |
info: true, | |
autoWidth: false, | |
order: [], | |
language: { | |
sDecimal: ",", | |
sEmptyTable: "Kayıt bulunamadı.", | |
sInfo: "_TOTAL_ kayıttan _START_ - _END_ arasındaki kayıtlar gösteriliyor", | |
sInfoEmpty: "Kayıt bulunamadı.", | |
sInfoFiltered: "(_MAX_ kayıt içerisinden bulunan)", | |
sInfoPostFix: "", | |
sInfoThousands: ".", | |
sLengthMenu: "Sayfada _MENU_ kayıt göster", | |
sLoadingRecords: "Yükleniyor...", | |
sProcessing: "Yükleniyor...", | |
sSearch: "Ara:", | |
sZeroRecords: "Eşleşen kayıt bulunamadı", | |
oPaginate: { | |
sFirst: "İlk", | |
sLast: "Son", | |
sNext: "Sonraki", | |
sPrevious: "Önceki" | |
}, | |
oAria: { | |
sSortAscending: ": artan sütun sıralamasını aktifleştir", | |
sSortDescending: ": azalan sütun soralamasını aktifleştir" | |
} | |
} | |
}); | |
//tr character sorting fix! | |
$.extend( $.fn.dataTableExt.oSort, { | |
"turkish-pre": function ( a ) { | |
var special_letters = { | |
"C": "Ca", "c": "ca", "Ç": "Cb", "ç": "cb", | |
"G": "Ga", "g": "ga", "Ğ": "Gb", "ğ": "gb", | |
"I": "Ia", "ı": "ia", "İ": "Ib", "i": "ib", | |
"O": "Oa", "o": "oa", "Ö": "Ob", "ö": "ob", | |
"S": "Sa", "s": "sa", "Ş": "Sb", "ş": "sb", | |
"U": "Ua", "u": "ua", "Ü": "Ub", "ü": "ub" | |
}; | |
for (var val in special_letters) | |
a = a.split(val).join(special_letters[val]).toLowerCase(); | |
return a; | |
}, | |
"turkish-asc": function ( a, b ) { | |
return ((a < b) ? -1 : ((a > b) ? 1 : 0)); | |
}, | |
"turkish-desc": function ( a, b ) { | |
return ((a < b) ? 1 : ((a > b) ? -1 : 0)); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment