Hello, is it possible to have a guide for use other languafe in i18n?
i need to load Italian language for this component, whan can i do it?
thank you
@valix85 you just need to load the javascript file with the language you want after the main selectpicker.js file but before your first call to .selectpicker();
As long as the file is loaded before your first call (and after the main file that loads in selectpicker) it should be good to go.
ok, it's work!
thank you very much
LIKE THIS
Only put the language.js and it works
I've been trying to figure out how to do this for days and can't get it to work. I emailed Silvio to no avail. Could someone please post complete example of how to use the right locale file when using this module?
Simply load the language file after bootstrap-select.
```html
This doesn't seem to work. Still seeing English text within the dropdown
for "select all" and "deselect all".
On Wed, Jun 28, 2017 at 8:16 PM, Casey Holzer notifications@github.com
wrote:
Simply load the language file after bootstrap-select.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/silviomoreto/bootstrap-select/issues/813#issuecomment-311826989,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEpgqY_zTBldCP8rQ0G6-Ap3rgDhYpNks5sIuzXgaJpZM4DA5nR
.
So, it does work. Just turns out these are not translated for German. Thanks
On Thu, Jun 29, 2017 at 10:27 AM, Doug Farmer doug4641@gmail.com wrote:
This doesn't seem to work. Still seeing English text within the dropdown
for "select all" and "deselect all".On Wed, Jun 28, 2017 at 8:16 PM, Casey Holzer notifications@github.com
wrote:Simply load the language file after bootstrap-select.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/silviomoreto/bootstrap-select/issues/813#issuecomment-311826989,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEpgqY_zTBldCP8rQ0G6-Ap3rgDhYpNks5sIuzXgaJpZM4DA5nR
.
Hrmm...they should be translated for German: https://github.com/silviomoreto/bootstrap-select/blob/master/dist/js/i18n/defaults-de_DE.js#L37-L38
It would be better to select language in options :-(
At some point we'll add the option to select the language in the options, but you'll still always have to load the language files separately.
Let me know when the option feature is sorted, Ta!
For those using webpack there is solution using require function:
<html lang="cs">
const langMap = {
cs: "cs_CZ",
en: "en_US",
};
if (document.documentElement.lang in langMap) {
require("bootstrap-select/js/i18n/defaults-" + langMap[document.documentElement.lang]);
} else {
console.error("Unknown language " + document.documentElement.lang);
}
Most helpful comment
Simply load the language file after bootstrap-select.
```html