# gt-next: General Translation Next.js SDK: DictionaryTranslationOptions URL: https://generaltranslation.com/en-US/docs/next/api/types/dictionary-translation-options.mdx --- title: DictionaryTranslationOptions description: API reference for the DictionaryTranslationOptions type --- ## Overview The `DictionaryTranslationOptions` type is used to pass variables to dictionary entries and specify their render behavior. It is used with [`useTranslations`](/docs/next/api/dictionary/use-translations) and [`getTranslations`](/docs/next/api/dictionary/get-translations) to pass variables to dictionary entries. **Buildtime Translation:** Variables are not translated with [`useTranslations`](/docs/next/api/dictionary/use-translations) and [`getTranslations`](/docs/next/api/dictionary/get-translations), only the original string. See [`tx`](/docs/next/api/strings/tx) for translating strings with dynamic content. ## Reference ### Parameters ', optional: true, default: 'undefined', }, }} /> ### Description | Prop | Description | | ---- | ----------- | | `variables` | An object where the keys identify where each value is mapped to in the dictionary entry.| --- ## Examples ### Passing variables In order to pass a variable to the dictionary entry, we need to do two things: (1) add a variable to the entry and (2) reference said variable in the [`d`](/docs/next/api/strings/use-gt) invocation. First, we add a variable to the dictionary entry with the following syntax: `{username}`. `username` is the name of the variable. ```jsx title="dictionary.ts" // [!code word:username] const dictionary = { greeting: { hello: 'Hello, {username}!', }, }; export default dictionary; ``` Next, we reference the variable: ```jsx title="Component.tsx" // [!code word:username] import { useTranslations } from 'gt-next'; const Component = () => { const t = useTranslations(); return
{t('greeting.hello', { username : 'Brian123' })}
; }; ``` ### Using ICU message format `gt-next` supports ICU message format, which allows you to also format your variables. ```jsx title="dictionary.ts" // [!code word:account-balance] const dictionary = { account: { balance: 'Your account balance: {dollars, number, ::currency/USD}!', }, }; export default dictionary; ``` Next, we reference the variable: ```jsx title="Component.tsx" // [!code word:account-balance] import { useTranslations } from 'gt-next'; const Component = () => { const t = useTranslations(); return
{ t( 'account.balance', { "dollars" : 1000000, } ) }
; }; ``` --- ## Notes * The `variables` object passes values to a dictionary entry. * The `variablesOptions` object defines the behavior of the variables. ### Next steps * See [dictionaries](/docs/next/guides/dictionaries) for more information on dictionaries and common practices. * See [`useTranslations`](/docs/next/api/dictionary/use-translations) or [`getTranslations`](/docs/next/api/dictionary/get-translations) for more information on dictionaries interface. * See [`ICU message format`](https://unicode-org.github.io/icu/userguide/format_parse/messages/) for more information on formatting options.