Skip to content

api_localization

Franky Van Liedekerke edited this page May 28, 2025 · 6 revisions

jTable API Reference - Localization

jTable can be easily localized using ready localization files or custom messages.


With Localization Files

You can localize jTable by including a localization script after the jTable script file:

<script type="text/javascript" src="/Scripts/jtable/jquery.jtable.js"></script>
<script type="text/javascript" src="/Scripts/jtable/localization/jquery.jtable.tr.js"></script>

The example above shows Turkish (tr) localization. You can find localization files for various languages or create your own. If you create a new localization file, consider sharing it with the jTable community on GitHub.


With Custom Localized Messages

You can use the messages option to localize a jTable instance during initialization. The default value of the messages option is:

messages: {
    serverCommunicationError: 'An error occurred while communicating with the server.',
    loadingMessage: 'Loading records...',
    noDataAvailable: 'No data available!',
    addNewRecord: 'Add new record',
    editRecord: 'Edit Record',
    areYouSure: 'Are you sure?',
    deleteConfirmation: 'This record will be deleted. Are you sure?',
    save: 'Save',
    saving: 'Saving',
    cancel: 'Cancel',
    deleteText: 'Delete',
    deleting: 'Deleting',
    error: 'Error',
    close: 'Close',
    cannotLoadOptionsFor: 'Cannot load options for field {0}',
    pagingInfo: 'Showing {0}-{1} of {2}',
    pageSizeChangeLabel: 'Row count',
    gotoPageLabel: 'Go to page',
    canNotDeletedRecords: 'Cannot delete {0} of {1} records!',
    deleteProggress: 'Deleted {0} of {1} records, processing...',
    sortingInfoPrefix: 'Sorting applied: ',
    sortingInfoSuffix: '',
    ascending: 'Ascending',
    descending: 'Descending',
    sortingInfoNone: 'No sorting applied',
    csvExport: 'CSV',
    printTable: '🖨️  Print'
}

Example: Turkish Localization

Here’s an example of Turkish localization:

var turkishMessages = {
        loadingMessage: 'Kayıtlar yükleniyor...',
        noDataAvailable: 'Hiç kayıt bulunmamaktadır!',
        addNewRecord: 'Yeni kayıt ekle',
        editRecord: 'Kayıt düzenle',
        areYouSure: 'Emin misiniz?',
        deleteConfirmation: 'Bu kayıt silinecektir. Emin misiniz?',
        save: 'Kaydet',
        saving: 'Kaydediyor',
        cancel: 'İptal',
        deleteText: 'Sil',
        deleting: 'Siliyor',
        error: 'Hata',
        close: 'Kapat',
        cannotLoadOptionsFor: '{0} alanı için seçenekler yüklenemedi!',
        pagingInfo: 'Gösterilen: {0}-{1}, Toplam: {2}',
        canNotDeletedRecords: '{1} kayıttan {0} adedi silinemedi!',
        deleteProgress: '{1} kayıttan {0} adedi silindi, devam ediliyor...',
        pageSizeChangeLabel: 'Satır sayısı',
        gotoPageLabel: 'Sayfaya git',
        sortingInfoPrefix: 'Sıralama uygulandı: ',
        ascending: 'Artan',
        descending: 'Azalan',
        sortingInfoNone: 'Sıralama uygulanmadı',
        csvExport: 'CSV',
        printTable: '🖨️  Print'
};

Setting Localized Messages for a jTable Instance

To set localized messages for a specific jTable instance during initialization:

$('#PersonTable').jtable({
    messages: turkishMessages
});

Setting Localized Messages for All jTable Instances

To set localized messages for all jTable instances on your website:

$.extend(true, $.jTable.prototype.options.messages, turkishMessages);

Clone this wiki locally