如何更改selected.js中警报的语言?

Geo*_*org 7 javascript jquery localization jquery-chosen

当您在selected.js中的多选框中键入不可用选项时,它将生成输出'无结果匹配' 查询 "'.有没有办法改变输出语言? 请参阅底部的文字.

Gan*_*rez 11

您可以更改3条消息.单选,多选和无结果文本.

$('#ID').chosen({
    no_results_text: "Sem resultados para",
    placeholder_text_single: "Selecione uma opção",
    placeholder_text_multiple: "Selecione as opções"
});
Run Code Online (Sandbox Code Playgroud)

在这种情况下,它已被翻译成葡萄牙语.


Bib*_*ath 5

您可以为它设置默认消息 -

// jQuery version: https://github.com/harvesthq/chosen/blob/master/example.jquery.html
$(".chzn-select").chosen({no_results_text: "Translated No results matched"});

// Prototype version: https://github.com/harvesthq/chosen/blob/master/example.proto.html
new Chosen($$(".chzn-select")[element_index],{no_results_text: "Translated No results matched"});
Run Code Online (Sandbox Code Playgroud)

除此之外,似乎没有任何i18n支持.