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
Weird i18n language settings and fallbacks in Select2 4.0.3 #5046
Comments
TL;DR: A declaration like |
+1 i got the same error on meteor and it crushes my app so changed version '4.0.3' from '^4.0.3' |
It looks like #4887 might fix this? |
@Ketcap wait, does that mean that this has been fixed in a more recent version? |
Still same problem in version 4.0.5, I have to remove html |
Finnally, I can customize message using this: const select2LangJa = $.fn.select2.amd.require('select2/i18n/ja');
select2LangJa.errorLoading = function () {
return '';
} Related #3799 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Is this still a problem in the latest 4.0.6 release? This would benefit from a failing test case. The fallback to the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I believe this is a duplicate of #5602 and was resolved in 4.0.9. |
Problems
Expected
Select2 language should be loaded in "French"
Results
Select2 language is "English"
Steps
<html lang="en">
, or whatever else language on a page$.fn.select2.defaults.set('language', 'fr');
OR using AMD :$.fn.select2.defaults.set('language', $.fn.select2.amd.require("select2/i18n/fr"));
$("#select2").select2({ minimumInputLength: 2, placeholder: 'Test' });
Jsbin
https://jsbin.com/wofisagiqu/edit?html,output
Notes
As per your documentation :
this works as intended, however I find it strange that an explicit javascript declaration is overridden by a top-level lang attribute.
Also, a default placeholder value should be loadable from i18n file, and over-writable with the placeholder option at init time. I don't see in https://select2.org/placeholders something about this, so apologies if it's already possible and I don't know about it.
Thanks for your consideration.
The text was updated successfully, but these errors were encountered: