layout: docs title: Localizations description: The Localizations API of Bootstrap Table. group: api
We can import all locale files what you need:
{% highlight html %} ```html ... {% endhighlight %}
And then use JavaScript to switch locale:
{% highlight javascript %} $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['en-US']) // $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['zh-CN']) // ... {% endhighlight %}
Or use data attributes to set locale for table:
{% highlight html %}
Or use JavaScript to set locale for table:
{% highlight javascript %} $('#table').bootstrapTable({ locale: 'en-US' }) {% endhighlight %}
You can use short code for the locale: {% highlight javascript %} $('#table').bootstrapTable({ locale: 'en' }) {% endhighlight %}
List of all existing translations with their short codes is on Github
You can custom the format localizations, the calling syntax:
{% highlight javascript %} $('#table').bootstrapTable({ formatName: function () {
return 'Format message'
} }) {% endhighlight %}
Parameter: undefined
Default: 'All'
Parameter: undefined
Default: 'Clear Search'
Parameter: undefined
Default: 'Columns'
Parameter: undefined
Default: 'Toggle all'
Parameter: totalRows
Default: 'Showing %s rows'
Parameter: undefined
Default: 'Fullscreen'
Parameter: undefined
Default: 'Loading, please wait…'
Parameter: undefined
Default: 'No matching records found'
Parameter: undefined
Default: 'Hide/Show pagination'
Parameter: undefined
Default: 'Show pagination'
Parameter: undefined
Default: 'Hide pagination'
Parameter: pageNumber
Default: '%s records per page'
Parameter: undefined
Default: 'Refresh'
Parameter: undefined
Default: 'Search'
Parameter: pageFrom, pageTo, totalRows
Default: 'Showing %s to %s of %s rows'
Parameter: undefined
Default: 'next page'
Parameter: page
Default: 'to page %s
Parameter: undefined
Default: 'previous page'
Parameter: undefined
Default: 'Hide card view'
Parameter: undefined
Default: 'Show card view'