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.
feat!: Next.js 13 RSC integration #149
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
Uh oh!
There was an error while loading. Please reload this page.
feat!: Next.js 13 RSC integration #149
Changes from 1 commit
b301d47436b0bb53beb1763b279af0bceeb643af24a78b3751df099670be9b07c0d88bbc417405d6ce8a026691e695c65b9b564f95a6434a1deee087a76d2b9c843c95af108c687863642c1155e0bd177f55424a8fc47fd7dc5011f849669629b3f42aee5ea531caaa1e774726bae9cf3d25ca5c8566d6298dea89112475b5cd0daab594511b2f3b2984a47adfa82effc861f60eaeefab2f9112bc1a5a6ed64e22e351444a52a74de076182335243df24919a87e77dba608512b6f720a94e0a3742a9b79c8b61b59d2e0252e9288ecc6c9b81ae18c1666c1df0472497fe46d953d7cc1db9655687315a418a30f81d60e63f17b245e89e90e279d95cc93ccd0a36ae25df089e33da97714eb4fd67dfb33fa30232d6cf87920bce94805e3fb47f7ce3ea7cc3b6c21e9eae018c65b52195be1c65538b06d9855ae58bb3e30b7bde5115ca8cf8f9f215760d60307bd177b69c49dc2fa08b91b84dc3b3bb9c7c2b844b1a344762f7435a613f64a4f61e200bdd9aa33782d10325b22e44b8b6bab0f8d6e23f44e273149e0504f5f70ffb615f18e4671b03065e249b82918a7a472f37b646b0122fa98d0fd490c284b61c06a3255572dff0b6b4831095d1ac858523dba017fd936e95b4b04bd7bd335afcfb219e13808acab0f3116bb405e6126f8d19873dc5916c8388bdbb558e6b3efbca0cfe7cae306a3071d0114aa6e825c747a6f601a5e4b2275fd1587b4e7766b9c9bc8d1d66aec4d5ee437fa14247a6e0a68a3946c41900d7610c66522fe5d9b423baaadd3e94f0ae6cee8ece992c7ac92a371d39a2f35534297a19dbc06d1e343ce0f408d920197a6fd4eee0d0e7835be475cb23481a59ab48fd237c131b6c8eb130a089b80aa60ad106c09850cd7ee73589076836f203f85ffa975a1c0b7323052bf4aef5a2b5039697c3c4f9360754ddd45d98a54938252e7ee25914549dc174c42f526bafe4ee98e18107f8186a46326365d9212efb50465c1bac3214d8e77f6365ad133fd67582d4c2b7a0d6631d12dfb80bd1c037a40fc4101bdefa4b2dbec9f33522b437fd084fd1b398d1b2ed7d7f54ec2581c16b371203bf05080861b2bce0bcca2dccf3810064c69249fce7c633e07dabf54c347d7c1659bdea3fd4b6a578bdcaae8c9818286c96c3d2ccc1763c69a4c5e5aa1b21dbff63bbfce17b9db2c88df3a0a1f04f542802c7b26262ccb2471603a34acf9698b65d5d8File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
next-intloutside of components (#339)The currently available APIs for using `next-intl` outside of components like `getTranslations` work well, but are limited to SSR. Using `useTranslations` in components is technically also limited to SSR at this point, but I have high hopes that React Server Context will eventually enable those to work for SSG too. However, React Server Context will not be available in functions like `generateMetadata` as this happens outside of the React render as far as I understand. Therefore we should provide APIs that anticipate this change. In the unlikely event that React Server Context will work somehow in these functions, we can still make the passed `locale` optional, but the transition will be smooth here. Moving to this new API rather sooner than later is a good idea to avoid churn. ### Upgrade guide **Before** ```tsx import {getTranslations, getFormatter, getNow, getTimeZone} from 'next-intl/server'; export async function generateMetadata() { const t = await getTranslations('LocaleLayout'); const format = await getFormatter(); const now = await getNow(); const timeZone = await getTimeZone(); } ``` **After** ```tsx import {getTranslator, getFormatter, getNow, getTimeZone} from 'next-intl/server'; export async function generateMetadata({params}) { // Note that this function is now called "getTranslator" const t = await getTranslator({ locale: params.locale, namespace: 'LocaleLayout' }); const format = await getFormatter({locale: params.locale}); const now = await getNow({locale: params.locale}); const timeZone = await getTimeZone({locale: params.locale}); } ```Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Uh oh!
There was an error while loading. Please reload this page.