View on GitHub

Localizations

The Localizations API of Bootstrap Table.

We can import all locale files what you need:

```html
<script src="bootstrap-table-en-US.js"></script>
<script src="bootstrap-table-zh-CN.js"></script>
...

And then use JavaScript to switch locale:

$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['en-US'])
// $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['zh-CN'])
// ...

Or use data attributes to set locale for table:

<table data-toggle="table" data-locale="en-US">
</table>

Or use JavaScript to set locale for table:

$('#table').bootstrapTable({
  locale: 'en-US'
})

You can use short code for the locale:

$('#table').bootstrapTable({
  locale: 'en'
})

List of all existing translations with their shortcodes is on Github

You can custom the format localizations, the calling syntax:

$('#table').bootstrapTable({
  formatName: function () {
    return 'Format message'
  }
})