# gt-next: General Translation Next.js SDK: useDefaultLocale URL: https://generaltranslation.com/en-US/docs/next/api/helpers/use-default-locale.mdx --- title: useDefaultLocale description: API reference for the useDefaultLocale hook --- {/* AUTO-GENERATED: Do not edit directly. Edit the template in content/docs-templates/ instead. */} ## Overview The `useDefaultLocale` hook retrieves the application's default locale from the [`` context](/docs/next/api/components/gtprovider). This locale represents the fallback language for your app and is typically used when a user's preferred locale is unavailable. `useDefaultLocale` is a client-side hook and *can only be used on client-side components*. Ensure your app is wrapped in a [``](/docs/next/api/components/gtprovider). See [`withGTConfig`](/docs/next/api/config/with-gt-config) for configuration. If no default locale is specified in [`withGTConfig`](/docs/next/api/config/with-gt-config), it defaults to `'en-US'`. For server-side, see [`getDefaultLocale`](/docs/next/api/helpers/get-default-locale). ## Reference ### Returns A string representing the application's default locale, e.g., `'en-US'`. --- ## Examples ### Basic usage Retrieve the application's default locale and display it in your component. ```jsx title="DefaultLocale.jsx" copy 'use client'; import { useDefaultLocale } from 'gt-next'; export default function DefaultLocale() { const defaultLocale = useDefaultLocale(); // [!code highlight] return

Default locale: {defaultLocale}

; // Display the default locale } ``` --- ## Notes - The `useDefaultLocale` hook relies on the [``](/docs/next/api/components/gtprovider) to access the context. Ensure your app is wrapped with a provider at the root level. - `useDefaultLocale` is client-side only. - Learn more about locale strings [here](/docs/core/locales). ## Next steps - See [`useLocale`](/docs/next/api/helpers/use-locale) to retrieve the user's locale.