#5995·select2

select with lang="en" ignores language overrides

Author: vjandreaCreated Mar 5, 2021Updated Aug 28, 2026
Labelsdocumentation4.xfeature: translation/i18ngood first issue

A message override works only if the lang attribute is not set or if lang is set to any value except "en". Tested with [email protected] and [email protected] and confirmed in Chrome and Firefox on Mac and Win10.

javascript
$(document).ready(function() {
    $('.message-override').select2(
    {
      language: {
        noResults: () => {
          return 'override works';
        }
      }
    });
});
<select class="message-override">           <!-- works -->
<select class="message-override" lang="fr"> <!-- works -->
<select class="message-override" lang="en"> <!-- does not work -->

JSbin: http://jsbin.com/ludiyeg/edit?html,js,output

P.S. btw the JSbin template proposed in the issue editor is outdated, it should load the latest stable version but it points to an old release candidate instead.