-1

I have a problem with the translation of select2 which is filled via an ajax call. I would like to translate the text result not found. If someone can help me it will be really nice. enter image description here

Moum
  • 73
  • 1
  • 12
  • 1
    For your information it's inside of select2.min.js but @Aro's answer is correct. – EHF Shahab Jul 18 '22 at 17:06
  • 1
    Searching turns up some answers, did you try that? Eg searching for "*select2 translation*" the first result is the official docs describing how to localise the whole plugin, or individual elements: https://select2.org/i18n ? The 2nd result is an example of exactly what you are asking: https://stackoverflow.com/questions/29306727/how-do-you-modify-no-results-found-language-in-select2-v4-0 – Don't Panic Jul 18 '22 at 18:37
  • Does this answer your question? [How do you modify "No Results Found" language in Select2 v4.0](https://stackoverflow.com/questions/29306727/how-do-you-modify-no-results-found-language-in-select2-v4-0) – Don't Panic Jul 18 '22 at 18:37
  • Hello thank you for your answer, i search for that before asking. What @Aro mention i already test that but doesn't work, may be i miss something. I'll try again. – Moum Jul 19 '22 at 09:47

1 Answers1

2

You can customize not found text using property noResults

Example of code

   {
     "language": {
       "noResults": function(){
           return "My custom No Results Found";
       }
   },
Aro
  • 1,078
  • 1
  • 7
  • 26