# General Translation React SDKs (gt-react, gt-next, gt-react-native): getGT URL: https://generaltranslation.com/en-GB/docs/react/tanstack-start/reference/functions/get-gt.mdx --- title: getGT description: Translate standalone strings in TanStack Start server functions with General Translation. API reference for getGT. --- The `getGT` function returns a synchronous string translation function for the current server request. Import it from `gt-tanstack-start/server`. ## Overview [#overview] ```ts import { getGT } from 'gt-tanstack-start/server'; const gt = await getGT(); const label = gt('Submit'); ``` ```ts getGT(messages?: Message[]): Promise ``` ## Parameters [#parameters] | Parameter | Description | Type | Optional | Default | | ---------- | ---------------------------------------------------------------------------------------------------- | ----------- | -------- | ------- | | `messages` | Compiler-provided messages to prefetch for development hot reload. Most callers omit this parameter. | `Message[]` | Yes | — | ## How it works [#how-it-works] `getGT` reads the locale and internationalisation setting created by [`gtMiddleware`](/docs/react/tanstack-start/reference/functions/gt-middleware). It prepares translations asynchronously, then resolves to a function that translates source strings synchronously. The function throws when called outside an active middleware request scope. ## Returns [#returns] **Type** `Promise<(content: string, options?: GTTranslationOptions) => string>` The resolved function accepts interpolation variables and [`GTTranslationOptions`](/docs/react/reference/types/inline-translation-options), such as `$context`, `$id`, and `$maxChars`. ## Example [#example] ```ts import { createServerFn } from '@tanstack/react-start'; import { getGT } from 'gt-tanstack-start/server'; export const loadTitle = createServerFn({ method: 'GET' }).handler(async () => { const gt = await getGT(); return gt('Account settings'); }); ```