# General Translation React SDKs (gt-react, gt-next): getTranslationsSnapshot URL: https://generaltranslation.com/en-US/docs/react/reference/functions/get-translations-snapshot.mdx --- title: getTranslationsSnapshot description: Load a locale's translations for the General Translation gt-react provider. API reference for getTranslationsSnapshot. --- The `getTranslationsSnapshot` function loads the translations for a locale in the shape that [``](/docs/react/reference/components/gt-provider) expects for its `translations` prop. Call it after initialization to produce the snapshot the provider consumes synchronously. *Available in `gt-react`, `gt-next`, `gt-tanstack-start`, and `gt-react-native`. Examples import from `gt-react`; import from your framework's package instead.* ## Overview [#overview] After [initializing](/docs/react/reference/config#initialization) `gt-react`, await `getTranslationsSnapshot` for the active locale and pass the result to the provider. ```tsx const translations = await getTranslationsSnapshot(locale); ``` *Note: call `getTranslationsSnapshot` after [`initializeGT`](/docs/react/reference/config#initialize) or [`initializeGTSPA`](/docs/react/reference/config#initialize-spa), which populate the translation cache it reads from.* ## How it works [#how-it-works] Initialization loads the translations into the cache; `getTranslationsSnapshot` returns a serializable snapshot of the cached translations for a locale. Passing this snapshot to [``](/docs/react/reference/components/gt-provider) lets translated content render synchronously, without a loading flash. ## Parameters [#parameters] | Parameter | Description | Type | Optional | Default | | --- | --- | --- | --- | --- | | [`locale`](#locale) | The locale to load translations for. | `string` | No | — | ### `locale` [#locale] **Type** `string` · **Required** The locale whose translations to load, as a BCP 47 code. ## Returns [#returns] **Type** `Promise>>` A promise resolving to the translations snapshot for the locale, in the shape `` expects for its `translations` prop. ## Examples [#examples] ```tsx title="src/routes/root.tsx" import { GTProvider, initializeGT, getTranslationsSnapshot, parseLocale, } from 'gt-react'; import gtConfig from '../../gt.config.json'; const loadTranslations = (locale: string) => import(`../_gt/${locale}.json`).then((m) => m.default); initializeGT({ ...gtConfig, loadTranslations }); export async function loadRoot(request: Request) { const locale = parseLocale(request); return { locale, translations: await getTranslationsSnapshot(locale), // [!code highlight] }; } export function Root({ locale, translations, children }) { return ( {children} ); } ``` ## Notes [#notes] - Call `getTranslationsSnapshot` after initialization. - Pass the result to the `translations` prop of [``](/docs/react/reference/components/gt-provider).