Select2 - can't customize messages

Hello community!

I’m trying to customize our messages having in mind the language the user has.

My first question is how do I find the version AUI is using for select2? I’m asking this because at the documentation, there’s a message saying that select2 is a wrapper from here but it does not say what version it uses.

I’ve tried to implement in our select2 element, the “language” attribute as shown here at the Translation object but I was not successful, it still displays the default messages of “Please write 2 more characters” and so on.

Then, I’ve searched for older versions of select2 and used the oldest names like “formatInputTooShort”'s attribute into the language object but still didn’t had any success.

Can you please help customize select2?

Best regards,

João Ferreira

So I’ve solved the problem.

AUI is using the Select2 3.5.3 version and its object is a little different than the latest one.

So, in order to customize messages, we don’t need the “language” object. We just need to implement at the object’s highest level, the attributes we need.

As example:

        multiple: true,
        tags: true,
        minimumInputLength: 2,
        placeholder: "Start typing",
        formatInputTooShort: function (input, min) {
          return "Please write at least " + min + " characters");
        formatNoMatches: function() {return "No Match!"},
        dataType: 'json',
        data: groupsArray,

You can check here for more attributes that you can change.

Thank you,

João Ferreira