C15T Logo

Internationalization (i18n)

Learn how to add translations to your Consent Manager.

tocOn 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.

app/layout.tsx
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]