C15T Logo

useTranslations

The useTranslations hook provides access to the consent manager's translations.

The useTranslations hook provides access to the consent manager's translations found in the store and updates when the translations change.

Usage

function MyComponent() {
  const translations = useTranslations();
  
  const title = translations.cookieBanner.title;
  // Use the translations in your component
  return <h1>{title}</h1>;
}

Returns

The useTranslations hook returns the translations object.

../../javascript/shared/internationalization.mdx#translation-types