-
-
Notifications
You must be signed in to change notification settings - Fork 246
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
Support dynamic locale in static generation server component #1225
Comments
Hey @amannn would you mind take a look? Thanks in advance |
Hey! I've been on vacation for a few weeks, sorry for the late reply. Is there a Does that cover your use case? |
Hey @amannn thanks for the reply. Unfortunately, I can't read |
How do the public pathnames look like to the user? Is There was a very similar case discussed here: #1107 (comment) (see the note with the adapted
I don't think that's possible, no. |
@amannn Sorry for the delay. Yes, the domain only support one single locale, we don't have |
I see. If SSG is mandatory anyway, you could consider using Ideally you'd be able to return a |
One more thought: You do have an infinite number of domains, is that correct? Otherwise the |
I'm going to close this issue, as this is mostly covered in #1107. |
Is your feature request related to a problem? Please describe.
Currently, I didn't find a way to support dynamic locale in static generation server component.
Here is my scenario:
I have a complex nextjs app, it includes multi-tenant sites
/app/blog/[domain]
, dashboard/app/dashboard
and landing page/app/root
.In a multi-tenant route
/app/blog/[domain]
, user can choose a locale (en/jp) from site settings. After reading the doc, I found that in server components, all messages are read fromi18n.ts
. However, without other params, I can't get site settings insidei18n.ts
, thus I can't setup locale for that route.Describe the solution you'd like
We can inject messages directly into server components, so
useTranslations
won't errorCould not resolve xxx in messages for locale en
.Describe alternatives you've considered
I'm converting all server components to client components to leverage
NextIntlClientProvider
to read the right messages. It's not very ideal IMO. We lost all benefits of server components.The text was updated successfully, but these errors were encountered: