# General Translation Platform: FileToTranslate (legacy) URL: https://generaltranslation.com/en-GB/docs/platform/core/reference/types/file-to-translate.mdx --- title: FileToTranslate (legacy) description: Review the legacy file input removed from Core v9 and its current replacement. API reference for FileToTranslate. --- `FileToTranslate` represented a file object in Core 8.x batch translation workflows. It is not exported by `generaltranslation` 9.x. **Changed in v9:** `FileToTranslate` was removed. Use `FileToUpload` for [`uploadSourceFiles`](/docs/platform/core/reference/gt-class-methods/translation/upload-source-files), then pass the returned file references to [`enqueueFiles`](/docs/platform/core/reference/gt-class-methods/translation/enqueue-files). ## Overview [#overview] The legacy type bundled a file's raw content, name, and format: ```typescript type FileToTranslate = { content: string; fileName: string; fileFormat: FileFormat; formatMetadata?: Record; dataFormat?: DataFormat; }; ``` ## Properties [#properties] | Property | Description | Type | Optional | | ------------------------------------ | ------------------------------ | --------------------------------------------------------------- | -------- | | [`content`](#content) | Raw file content. | `string` | No | | [`fileName`](#file-name) | File identifier. | `string` | No | | [`fileFormat`](#file-format) | Legacy file-format identifier. | string union | No | | [`formatMetadata`](#format-metadata) | Format-specific metadata. | `Record` | Yes | | [`dataFormat`](#data-format) | Data format within the file. | [`DataFormat`](/docs/platform/core/reference/types/data-format) | Yes | ### `content` [#content] **Type** `string` · **Required** Raw file content. ### `fileName` [#file-name] **Type** `string` · **Required** File identifier, such as `common.json` or `docs/start.mdx`. ### `fileFormat` [#file-format] **Type** string union · **Required** A legacy file-format identifier, such as `'JSON'`, `'PO'`, `'MDX'`, or `'HTML'`. ### `formatMetadata` [#format-metadata] **Type** `Record` · **Optional** Format-specific metadata. ### `dataFormat` [#data-format] **Type** [`DataFormat`](/docs/platform/core/reference/types/data-format) · **Optional** Data format within the file: `'JSX'`, `'ICU'`, or `'I18NEXT'`. ## Legacy example [#legacy-example] ```typescript // generaltranslation 8.x only import type { FileToTranslate } from 'generaltranslation'; // JSON file const jsonFile: FileToTranslate = { content: JSON.stringify({ "welcome": "Welcome", "save": "Save" }), fileName: 'common.json', fileFormat: 'JSON', dataFormat: 'I18NEXT' }; ``` ```typescript // MDX file const mdxFile: FileToTranslate = { content: `# Getting Started\n\nWelcome to our platform!`, fileName: 'docs/start.mdx', fileFormat: 'MDX', dataFormat: 'JSX' }; ``` ## Current replacement [#replacement] In 9.x, import `FileToUpload` from `generaltranslation/types`, upload the source, and use the returned reference for subsequent operations: ```typescript import { GT } from 'generaltranslation'; import type { FileToUpload } from 'generaltranslation/types'; const gt = new GT({ apiKey: process.env.GT_API_KEY, projectId: process.env.GT_PROJECT_ID, }); const source = { content: JSON.stringify({ welcome: 'Welcome' }), fileName: 'common.json', fileFormat: 'JSON', locale: 'en', } satisfies FileToUpload; const { uploadedFiles } = await gt.uploadSourceFiles( [{ source }], { sourceLocale: 'en' } ); ```