Skip to content
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

Add i18n extend addendum #5983

Closed

Conversation

doctormad
Copy link

Documentation addendum how to extend a translation

@kevin-brown
Copy link
Member

Is there any chance you can make a ticket about how to properly extend translations? This is definitely not the recommended way.

The recommended way involves relying on the language fallback chain to define your translation overrides instead of modifying the internals of Select2.

var languageFr = [
  {
    noResults: function() { // Custom overrides for translation keys
      return 'Pas de bras pas de chocolat';
    }
  },
  'fr' // Fallback language for anything not overridden
];

$('select').select2({}
  language: languageFr
});

@stale
Copy link

stale bot commented Jun 2, 2021

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.

@stale stale bot added the status: stale label Jun 2, 2021
@stale stale bot closed this Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants