Since I'm building a Dutch website I would like to have the loading text on bootstrap buttons in Dutch as well. By default the text is Loading...
can I change this default without having to add data-loading-text="Bezig..."
in every button?
Since I'm building a Dutch website I would like to have the loading text on bootstrap buttons in Dutch as well. By default the text is Loading...
can I change this default without having to add data-loading-text="Bezig..."
in every button?
2 Answers
Reset to default 10You can 'initialize' your buttons with the data attribute when you load the page using standard jQuery:
$('button').data('loading-text', 'Bezig...');
OR, you can set the options for the button component like you would other components in Bootstrap:
$('button').button({loadingText: 'Bezig...'});
DEMO
I use this (after the bootstrap.min.js) to set it globally, it write the loadingText directly in the plugin prop, add this code in the jquery ready function :
$.fn.button.Constructor.DEFAULTS = {
loadingText: '<i class="fa fa-spin fa-spinner"></i> Chargement…'
}