How can I use a different language than the locale in the URL? #1370
-
I want to display content in a different language without changing the locale in the URL. For example, I want to use Japanese (ja) content while the URL shows English (en). The |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Can you share some background on why you'd want to show a different locale in the URL than what is used in your content? But yes, the workaround you've mentioned is definitely valid. There was a related discussion recently here: #1355. |
Beta Was this translation helpful? Give feedback.
For
getTranslations
the situation is somewhat straightforward, as since we know that we're on the server side, we can consulti18n/request.ts
to load relevant messages and make them available to the call site immediately. On the client side however, withuseTranslations
, this is unfortunately not the case—therefore you need to useNextIntlClientProvider
.Nope, definitely fine!