# gt-react: General Translation React SDK: getLocales URL: https://generaltranslation.com/en-US/docs/react/api/helpers/get-locales.mdx --- title: getLocales description: API reference for the getLocales server-side method --- {/* AUTO-GENERATED: Do not edit directly. Edit the template in content/docs-templates/ instead. */} ## Overview The `getLocales` function retrieves the list of supported locales configured for your application during server-side rendering. `getLocales` is a server-side method and can only be used in server components. For client-side usage, see [`useLocales`](/docs/react/api/helpers/use-locales). ## Reference ### Returns `string[]` — An array of BCP 47 [locale codes](/docs/core/locales) representing the supported locales, e.g., `['en-US', 'fr', 'ja']`. --- ## Examples ### Basic usage ```jsx title="LocaleList.jsx" copy import { getLocales } from 'gt-react/server'; export default function LocaleList() { const locales = getLocales(); // [!code highlight] return ( ); } ``` --- ## Notes - The supported locales are configured in your [`gt.config.json`](/docs/react/api/config/gt-config-json) file. - `getLocales` is server-side only. For client components, use [`useLocales`](/docs/react/api/helpers/use-locales). ## Next steps - Learn how to configure supported locales in [`gt.config.json`](/docs/react/api/config/gt-config-json). - See [`useLocales`](/docs/react/api/helpers/use-locales) for the client-side equivalent.