wenzhixin/multiple-select

Wrong fallback locale

BathoryPeter opened this issue · 0 comments

How to reproduce

Initialize multipleSelect with a locale value that is not exists in multiple-select-locale-all.js:

$('#my-select').multipleSelect({
      locale: 'xx-YY',
});

All the format methods returns labels with zh-TW locale instead of English.

Possible fix

I'm not sure where is the problem, but its suspicious to me that in localization files locales should be extended instead of defaults:

$.extend($.fn.multipleSelect.locales, $.fn.multipleSelect.locales['zh-TW']);