# General Translation React SDKs (gt-react, gt-next, gt-react-native): getGT
URL: https://generaltranslation.com/en-US/docs/react/tanstack-start/reference/functions/get-gt.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Translate standalone strings in the TanStack Start runtime with General Translation. API reference for getGT.

The `getGT` function asynchronously returns a synchronous string translation function for the current server request or browser. Import it from `gt-tanstack-start`.

## Overview [#overview]

```ts
import { getGT } from 'gt-tanstack-start';

const gt = await getGT();
const label = gt('Submit');
```

```ts
getGT(messages?: Message[]): Promise<GTFunctionType>
```

## 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]

On the server, `getGT` reads the locale and internationalization setting created by [`gtMiddleware`](/docs/react/tanstack-start/reference/functions/gt-middleware). In the browser, it reads the condition store initialized by [`initializeGT`](/docs/react/reference/config#initialize). It prepares translations asynchronously, then resolves to a function that translates source strings synchronously.

Server calls throw 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';

export const loadTitle = createServerFn({ method: 'GET' }).handler(async () => {
  const gt = await getGT();
  return gt('Account settings');
});
```

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
