-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
feat: 1.1.0 #205
Merged
Merged
feat: 1.1.0 #205
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This was referenced Oct 2, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #210
Closes #209
Closes #208
Closes #200
next-international 1.1.0 includes new features and improvements for the App Router. Upgrade now by installing the latest version:
#zero
works with{ count: 0 }
(App & Pages Router)rewriteDefault
strategy redirects to hide the default locale (App Router)Plurals with
#zero
works with{ count: 0 }
(App & Pages Router)Previously, plurals using
#zero
only worked with{ count: 0 }
for some languages, because of how theIntl.PluralRules
API works. We extended it to make it available on any language, so this example now works as expected:Preserve search params (App Router)
By default, next-international doesn't preserve search params when changing the locale. This is because
useSearchParams()
will opt-out the page from Static Rendering if you don't wrap the component in aSuspense
boundary.If you want to preserve search params, you can manually use the
preserveSearchParams
option insideuseChangeLocale
:Then, don't forget to wrap the component in a
Suspense
boundary to avoid opting out the entire page from Static Rendering:rewriteDefault
strategy redirects to hide default locale (App Router)The
rewriteDefault
strategy used to only show the locale segment in the URL when not using the default locale now redirects and hides the default locale to avoid having the same page twice.Default locale:
en
/
→/
/
→/
/en
→/en
/en
→/
/fr
→/fr
/fr
→/fr
Support Static Rendering in nested Client Components (App Router)
We had an issue that would show the keys instead of the translation when statically rendering a page that had Client Components. The correct translation would only be set during hydration.
The
fallbackLocale
prop has been moved fromI18nProviderClient
tocreateI18nClient
, to matchcreateI18nServer
:See changes
Before
After: