Skip to content

select2.full.js:5181 Select2: The language file for "./i18n/zh" could not be automatically loaded. A fallback will be used instead. How to eliminate this warn ? #1386

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

Open
gzbenson opened this issue Mar 31, 2025 · 0 comments

Comments

@gzbenson
Copy link

gzbenson commented Mar 31, 2025

My Django Project config :

Django 4.2.17

Django-autocomplete-light plugin 3.12.1


LANGUAGE_CODE = "zh-hans" in settings.py

USE_I18N = True

disable local translation middleware


in My Django template , base.html

i set html lang ="zh-CN" in my base.html and set meta charset="utf-8" in head


My problem :

I got the waring in browser when i use widgets for my form's field by 3td party plugin autocomplete.ModelSelect2() in ModelForm and render by django template {{ form media }} , although there is an warning message, the function is work , the result message of the select button show my language .

warning message: Select2: The language file for "./i18n/zh" could not be automatically loaded. A fallback will be used instead.


I have checked the html code of the page , The path to the file is correct..

render by Django Template {{ form.media }}

<script src="/static/admin/js/vendor/select2/select2.full.js"></script> <script src="/static/autocomplete_light/autocomplete_light.js"></script> <script src="/static/autocomplete_light/select2.js"></script> <script src="/static/autocomplete_light/i18n/zh-CN.js"></script> --------------------------------------------------------

If i use the low case language file settings , like en.js eu.js ... , anything is normal , no warning message yet .

but when i change back to zh-CN.js zh-TW.js pt-BR.js ....I will get the waring message again

what can i do to settle this warning ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant