How to include all locales? #2719
Answered
by
fturmel
web-programmer-here
asked this question in
Q&A
-
How can I include all locales?
what I want to do is import all locales and pass the language
my application has different languages and I want to pass language codes to date-fns |
Beta Was this translation helpful? Give feedback.
Answered by
fturmel
Oct 23, 2021
Replies: 1 comment 3 replies
-
You need to name the wildcard export if you are to reference it in your code. If this is client-side, keep in mind that this might significantly affect your bundle size. import * as locales from 'date-fns/locale'
console.log(locales.enUS.code) // en-US |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
web-programmer-here
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to name the wildcard export if you are to reference it in your code. If this is client-side, keep in mind that this might significantly affect your bundle size.