# gt-next: General Translation Next.js SDK: useSetLocale URL: https://generaltranslation.com/en-US/docs/next/api/helpers/use-set-locale.mdx --- title: useSetLocale description: API reference for the useSetLocale hook --- {/* AUTO-GENERATED: Do not edit directly. Edit the template in content/docs-templates/ instead. */} ## Overview The `useSetLocale` hook is used to set the user's locale. This is client-side only, and it must be wrapped in a [``](/docs/next/api/components/gtprovider) component. ## Reference ### Returns A function that sets the user's locale. --- ## Examples ### Basic usage ```jsx import { useSetLocale } from 'gt-next'; export default function MyComponent() { const setLocale = useSetLocale(); return ; } ``` --- ## Notes - The `useSetLocale` is used to set the user's locale. - Learn more about locale codes [here](/docs/core/locales). ## Next steps - Learn more about the [``](/docs/next/api/components/gtprovider) component. - Learn more about the [`useLocale`](/docs/next/api/helpers/use-locale) hook.