设置语言不起作用select2 [英] Set language not working select2
本文介绍了设置语言不起作用select2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<select data-placeholder="Select or type" data-minlength="2" multiple = "multiple" name='arrAval' id='listAval' class="js-basic-multiple form-control" required>
所以这里是问题:
正如文档所述,我应该能够为此组件设置语言
As the documentation says I should be able to set language for this component:
$(".js-basic-multiple").select2({
language: "language-wanted"
});
无论设置哪种语言,它都将返回未找到结果".请明确说明,例如 https://select2.github.io/examples.html#matcher 会返回语言:"es""的否en contratraron resultados"
It's returning "no results found" no matter which language I set. Just to be clear, as in https://select2.github.io/examples.html#matcher it returns "No se encontraron resultados" for 'language:"es"'
推荐答案
<script src="libs/select2-4.0.2-rc.1/dist/js/i18n/<here-goes-language>.js"></script>
Keving Brown 表示,上述包含项缺失.如问题中引用的示例所示,西班牙语文件为"es.js"
The include above was missing as Keving Brown said. As the example quoted in the question the file for spanish would be "es.js"
这篇关于设置语言不起作用select2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文