Skip to content

6. Localization

Emrah KONDUR edited this page Jan 3, 2023 · 2 revisions

Default language is English. You can change with other languages or custumize it. Set json url parameter to Language method for other languages from CDN.

.Language("https://cdn.datatables.net/plug-ins/1.10.20/i18n/Turkish.json")

Or add json file local and customize it. Reference:

.Language(Url.Content("/Scripts/Turkish.json"))

Json example is below:

{
    "sEmptyTable":     "No data available in table",
    "sInfo":           "Showing _START_ to _END_ of _TOTAL_ entries",
    "sInfoEmpty":      "Showing 0 to 0 of 0 entries",
    "sInfoFiltered":   "(filtered from _MAX_ total entries)",
    "sInfoPostFix":    "",
    "sInfoThousands":  ",",
    "sLengthMenu":     "Show _MENU_ entries",
    "sLoadingRecords": "Loading...",
    "sProcessing":     "Processing...",
    "sSearch":         "Search:",
    "sZeroRecords":    "No matching records found",
    "oPaginate": {
        "sFirst":    "First",
        "sLast":     "Last",
        "sNext":     "Next",
        "sPrevious": "Previous"
    },
    "oAria": {
        "sSortAscending":  ": activate to sort column ascending",
        "sSortDescending": ": activate to sort column descending"
    }
}

Or, you can just change what you want with builder;

.Language(lang => lang.EmptyTable("No Data").Search("Search by: "))
  • Decimal: Set the decimal place character. Reference:
  • EmptyTable: This string is shown when the table is empty of data (regardless of filtering). Reference:
  • Info: This string gives information to the end user about the information that is current on display on the page. Reference:
  • InfoEmpty: Display information string for when the table is empty. Reference:
  • InfoFiltered: When a user filters the information in a table, this string is appended to the information (info) to give an idea of how strong the filtering is. Reference:
  • InfoPostFix: If can be useful to append extra information to the info string at times, and this variable does exactly that. Reference:
  • Thousands: The thousands separator option is used for output of information only. Reference:
  • LengthMenu: Detail the action that will be taken when the drop down menu for the pagination length option is changed. Reference:
  • LoadingRecords: This message is shown in an empty row in the table to indicate to the end user the the data is being loaded. Reference:
  • Processing: Text that is displayed when the table is processing a user action (usually a sort command or similar). Reference:
  • Search: Sets the string that is used for DataTables filtering input control. Reference:
  • ZeroRecords: Text shown inside the table records when the is no information to be displayed after filtering. Reference:
Clone this wiki locally