How to retrieve a list of supported locales in Next.js 13? #263
-
In the Next.js 13 example, the LocaleSwitcher component toggles between two locally-defined locales. Needing to define the locales in place is bad practice, and this example doesn't work with more than two locales. Just as |
Beta Was this translation helpful? Give feedback.
Answered by
amannn
May 2, 2023
Replies: 1 comment 8 replies
-
The Next.js 13 example is simplistic by intention. You can of course move your configuration to a separate module that you reference in all relevant places. E.g.: // src/config.ts
export default {
locales: ['en', 'de'],
defaultLocale: 'en'
}; Hope this helps! |
Beta Was this translation helpful? Give feedback.
8 replies
Answer selected by
albertothedev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Next.js 13 example is simplistic by intention. You can of course move your configuration to a separate module that you reference in all relevant places.
E.g.:
Hope this helps!