New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to use i18n #813
Comments
@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! |
LIKE THIS <script> $(document).ready(function(){ $('#combogrados').selectpicker({ language: 'ES' }); }); </script> |
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. <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/js/bootstrap-select.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/js/i18n/defaults-de_DE.min.js"></script> |
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 ***@***.***> wrote:
Simply load the language file after bootstrap-select.
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/js/bootstrap-select.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/js/i18n/defaults-de_DE.min.js"></script>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#813 (comment)>,
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 ***@***.***> 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 ***@***.***>
wrote:
> Simply load the language file after bootstrap-select.
>
> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/js/bootstrap-select.min.js"></script>
> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/js/i18n/defaults-de_DE.min.js"></script>
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#813 (comment)>,
> 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 <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);
} |
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
The text was updated successfully, but these errors were encountered: