jTable.org

A JQuery plugin to create AJAX based CRUD tables.

Demos | Documentation | Discussion | Themes | Downloads | About
jTable on GitHub Github

jTable API Reference - Localization

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

With localization files

You can easily localize jTables on your site by adding a localization script in the localization folder of the library, just after the jtable script file:

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

Turkish (tr) localization is shown above. There are translation of jTable messages in variant languages. You can also write your own localization script files. If you do it, you can share localization file with jTable community on github.

With custom localized messages

You can use the messages option to localize a jTable instance on initialization. Default value of the messages option is shown below:

messages: {
    serverCommunicationError: 'An error occured while communicating to 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: 'Can not load options for field {0}',
    pagingInfo: 'Showing {0}-{1} of {2}',
    pageSizeChangeLabel: 'Row count',
    gotoPageLabel: 'Go to page',
    canNotDeletedRecords: 'Can not deleted {0} of {1} records!',
    deleteProggress: 'Deleted {0} of {1} records, processing...'
}

Here, a sample localization for Turkish language:

//Localization
var turkishMessages = {
    serverCommunicationError: 'Sunucu ile iletişim kurulurken bir hata oluştu.',
    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örterilen: {0}-{1}, Toplam: {2}',
    pageSizeChangeLabel: 'Satır sayısı',
    gotoPageLabel: 'Sayfaya git',
    canNotDeletedRecords: '{1} kayıttan {0} adedi silinemedi!',
    deleteProggress: '{1} kayıttan {0} adedi silindi, devam ediliyor...'
};

To set localized messages for a jTable instance (in jTable initialization):

//Prepare jtable plugin
$('#PersonTable').jtable({            
    messages: turkishMessages,
});

To set localized messages for all jTable instances of your web site:

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

See How to set general options to get detailed information about setting general options for jTable.

Advertisement: Professional startup template for ASP.NET MVC & AngularJs by creator of jTable!

ASP.NET Zero screenshot Based on metronic theme, includes pre-built pages like login, register, tenant, role, user, permission and setting management. Learn more...