Types
EntryMetadata
Typdefinition für Metadaten, die das Übersetzungsverhalten in Entry-Objekten anpassen
Übersicht
EntryMetadata bietet optionale Konfigurationsmöglichkeiten für Entry-Objekte in Batch-Übersetzungsvorgängen.
type EntryMetadata = {
  context?: string;
  id?: string;
  hash?: string;
  dataFormat?: DataFormat;
  sourceLocale?: string;
  actionType?: ActionType;
  timeout?: number;
  regionCode?: string;
  scriptCode?: string;
};Eigenschaften
| Eigenschaft | Typ | Beschreibung | 
|---|---|---|
| context? | string | Kontext für Übersetzer | 
| id? | string | Eindeutige Kennung | 
| hash? | string | Inhalts-Hash für Caching | 
| dataFormat? | DataFormat | Formatangabe | 
| sourceLocale? | string | Override der Quell-Locale | 
| actionType? | ActionType | Bevorzugtes Übersetzungsmodell | 
| timeout? | number | Anfrage-Timeout (ms) | 
| regionCode? | string | ISO-Regionscode | 
| scriptCode? | string | ISO-Schriftcode | 
Verwandte Typen
type DataFormat = 'JSX' | 'ICU' | 'I18NEXT';
type ActionType = 'standard' | 'fast' | string;Beispiele
Grundlegende Verwendung
import { Entry, EntryMetadata } from 'generaltranslation';
const metadata: EntryMetadata = {
  context: 'Button-Text',
  actionType: 'fast'
};
const entry: Entry = {
  source: 'Speichern',
  targetLocale: 'es',
  metadata
};Mit dem ICU-Format
const icuEntry: Entry = {
  source: '{count, plural, other {{count} items}}',
  targetLocale: 'es',
  metadata: {
    dataFormat: 'ICU',
    context: 'Elementanzahl'
  }
};Verwandte Typen
- Entry- Übergeordneter Typ, der diese Metadaten verwendet
- ActionType- Optionen des Übersetzungsmodells
Wie ist dieser Leitfaden?

