# generaltranslation: General Translation Core SDK: FileToTranslate
URL: https://generaltranslation.com/it/docs/core/types/file-to-translate.mdx
---
title: FileToTranslate
description: Definizione di tipo per gli oggetti file usati nelle operazioni di traduzione in batch dei file
---
## Panoramica
Questo tipo è deprecato. L'API attuale usa `FileToUpload` per caricare i file (tramite [`uploadSourceFiles`](/docs/core/class/methods/translation/upload-source-files)) e `FileReferenceIds` per mettere in coda le traduzioni (tramite [`enqueueFiles`](/docs/core/class/methods/translation/enqueue-files)).
`FileToTranslate` veniva usato in precedenza per rappresentare un oggetto file per operazioni di traduzione in batch.
```typescript
type FileToTranslate = {
content: string;
fileName: string;
fileFormat: FileFormat;
formatMetadata?: Record;
dataFormat?: DataFormat;
};
```
## Proprietà
| Proprietà | Tipo | Obbligatorio | Descrizione |
| ----------------- | --------------------- | ------------ | -------------------------------- |
| `content` | `string` | **Sì** | Contenuto non elaborato del file |
| `fileName` | `string` | **Sì** | Identificatore del file |
| `fileFormat` | `FileFormat` | **Sì** | Formato del file |
| `formatMetadata?` | `Record` | No | Metadati specifici del formato |
| `dataFormat?` | `DataFormat` | No | Formato dei dati nel file |
### Tipi correlati
```typescript
type FileFormat = 'JSON' | 'PO' | 'POT' | 'MDX' | 'MD' | 'HTML' | 'TXT' | string;
type DataFormat = 'JSX' | 'ICU' | 'I18NEXT';
```
## Esempi
### File JSON
```typescript copy
import { FileToTranslate } from 'generaltranslation';
const jsonFile: FileToTranslate = {
content: JSON.stringify({
"welcome": "Welcome",
"save": "Save"
}),
fileName: 'common.json',
fileFormat: 'JSON',
dataFormat: 'I18NEXT'
};
```
### File MDX
```typescript copy
const mdxFile: FileToTranslate = {
content: `# Getting Started\n\nWelcome to our platform!`,
fileName: 'docs/start.mdx',
fileFormat: 'MDX',
dataFormat: 'JSX'
};
```
## Tipi correlati
* [`EnqueueFilesOptions`](/docs/core/types/enqueue-files-options) - Opzioni per l'elaborazione in batch