# generaltranslation: General Translation Core SDK: Variable URL: https://generaltranslation.com/en-US/docs/core/types/Variable.mdx --- title: Variable description: Type definition for variables used in translation content --- ## Overview `Variable` represents a placeholder for dynamic content in translations. ```typescript type Variable = { k: string; i?: number; v?: VariableType; }; ``` ## Properties | Property | Type | Description | |----------|------|-------------| | `k` | `string` | Variable key/name | | `i?` | `number` | Internal identifier | | `v?` | `VariableType` | Formatting type | ### VariableType ```typescript type VariableType = 'v' | 'n' | 'd' | 'c'; ``` | Value | Description | |-------|-------------| | `'v'` | Plain text substitution | | `'n'` | Number formatting | | `'d'` | Date formatting | | `'c'` | Currency formatting | ## Examples ### Basic usage ```typescript copy import { Variable } from 'generaltranslation'; // Text variable const nameVariable: Variable = { k: 'userName' }; // Number variable const countVariable: Variable = { k: 'itemCount', v: 'n' }; // Currency variable const priceVariable: Variable = { k: 'price', v: 'c' }; ``` ### In JSX content ```typescript copy const welcomeContent = [ 'Welcome back, ', { k: 'userName' } as Variable, '! You have ', { k: 'messageCount', v: 'n' } as Variable, ' messages.' ]; ``` ## Related types * [`VariableType`](/docs/core/types/variable-type) - Formatting type specifications