---
title: "Core — useTranslation"
canonical: https://sky-ui.cf.sky.com/core/hooks/use-translation
apiPackages: [{"name":"@sky-uk/ui-core","representedVersion":"13.2.0"}]
---

# Core — useTranslation

```js
import { useTranslation } from '@sky-uk/ui-core';
```

The `useTranslation` hook can be used to offer translations for hardcoded pieces of content.

---

## Example Implementation

```tsx
() => {
  const Example = () => {
    const Component = () => {
      const text = useTranslation("component.text", { fallback: "My fallback" });
      return <p>{text}</p>;
    };
    return (
      <>
        <Component />

        <TranslationContext.Provider
          value={{ component: { text: "My translated text" } }}
        >
          <Component />
        </TranslationContext.Provider>
      </>
    );
  }
}
```
