Internationalization (i18n)
Learn how to add translations to your Consent Manager.
On this page
[Error: Could not find section "overview" in ../javascript/shared/internationalization.mdx]
Implementation
Pass the translations
object in your ConsentManagerProvider
options to configure the translations for your application.
import { ConsentManagerProvider } from '@c15t/react';
export default function Layout({ children }: { children: React.ReactNode }) {
return (
<ConsentManagerProvider options={{
// ... rest of your config
translations: {
defaultLanguage: 'en',
translations: {
en: {
common: {
acceptAll: 'Accept all',
},
cookieBanner: {
title: 'Cookie Banner',
description: 'This is a cookie banner',
},
},
},
},
}}>
{children}
</ConsentManagerProvider>
);
}
[Error: Could not find section "types" in ../javascript/shared/internationalization.mdx]