Bootstrap Theme Toggler
API

API

run

  • Type: Object
  • Default: {}

The run() initializes the theme toggler and enables it to function as expected. Calling this method sets up the necessary event listeners and configuration.

JavaScript
BootstrapThemeToggler.run();

Without invoking this function, the library will not initialize.

setLanguage

  • Type: string
  • Default: ''

The setLanguage() updates the language used in the theme toggler. Calling this method changes the text of the dropdown menu items and the button to the specified language.

JavaScript
BootstrapThemeToggler.setLanguage('es');
💡

If the translation file path is invalid, no valid language is detected, or there's an error loading translations, the system will fallback to the default language.