Types
EntryMetadata
Type definition for metadata that customizes translation behavior in Entry objects
Overview
EntryMetadata provides optional configuration for Entry objects in batch translation operations.
type EntryMetadata = {
  context?: string;
  id?: string;
  hash?: string;
  dataFormat?: DataFormat;
  sourceLocale?: string;
  actionType?: ActionType;
  timeout?: number;
  regionCode?: string;
  scriptCode?: string;
};Properties
| Property | Type | Description | 
|---|---|---|
| context? | string | Context for translators | 
| id? | string | Unique identifier | 
| hash? | string | Content hash for caching | 
| dataFormat? | DataFormat | Format specification | 
| sourceLocale? | string | Source locale override | 
| actionType? | ActionType | Translation model preference | 
| timeout? | number | Request timeout (ms) | 
| regionCode? | string | ISO region code | 
| scriptCode? | string | ISO script code | 
Related Types
type DataFormat = 'JSX' | 'ICU' | 'I18NEXT';
type ActionType = 'standard' | 'fast' | string;Examples
Basic Usage
import { Entry, EntryMetadata } from 'generaltranslation';
const metadata: EntryMetadata = {
  context: 'Button text',
  actionType: 'fast'
};
const entry: Entry = {
  source: 'Save',
  targetLocale: 'es',
  metadata
};With ICU Format
const icuEntry: Entry = {
  source: '{count, plural, other {{count} items}}',
  targetLocale: 'es',
  metadata: {
    dataFormat: 'ICU',
    context: 'Item count'
  }
};Related Types
- Entry- Parent type using this metadata
- ActionType- Translation model options
How is this guide?

