Working with translations in client components
TranslationProvider
in a Server ComponentuseTranslation
hook in your Client Components to access translationsTranslationProvider
:
TranslationProvider
component:
next-intl
under the hood to provide translationsuseTranslation
hook to access translations:
useTranslation
hook:
t
function that you can use to access translations within that namespaceuseTranslation
hook helps you access a specific section of your translations:
Keep Client Components Small
Use TypeScript for Type Safety
Handle Missing Translations