Skip to content

Commit

Permalink
fix(locale): don't try dynamically importing the default locale (#2098)
Browse files Browse the repository at this point in the history
If `"en"` is passed as locale to the `<EmberFlatpickr />` component, the
addon will try importing a file `flatpickr/dist/l10n/en.js` which does
not exist as English is the default language that is included in the
core and doesn't need to be imported additionally.
  • Loading branch information
anehx committed Mar 18, 2024
1 parent 00b56ee commit adb4195
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ember-flatpickr/src/components/ember-flatpickr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export default class EmberFlatpickr extends Component<EmberFlatpickrArgs> {
Object.entries(rest).filter((entry) => entry[1] !== undefined),
);

if (typeof this.args.locale === 'string') {
if (typeof this.args.locale === 'string' && this.args.locale !== "en") {
await import(`flatpickr/dist/l10n/${this.args.locale}.js`);
}

Expand Down

0 comments on commit adb4195

Please sign in to comment.