Skip to content

How can I use a different language than the locale in the URL? #1370

Answered by amannn
LoganBaek97 asked this question in Q&A
Discussion options

You must be logged in to vote

For getTranslations the situation is somewhat straightforward, as since we know that we're on the server side, we can consult i18n/request.ts to load relevant messages and make them available to the call site immediately. On the client side however, with useTranslations, this is unfortunately not the case—therefore you need to use NextIntlClientProvider.

I'm also curious about whether there would be any performance issues if we use nested NextIntlClientProviders.

Nope, definitely fine!

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@LoganBaek97
Comment options

@amannn
Comment options

@LoganBaek97
Comment options

@amannn
Comment options

Answer selected by LoganBaek97
@LoganBaek97
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants