# generaltranslation: General Translation Core SDK: setupProject URL: https://generaltranslation.com/en-US/docs/core/class/methods/translation/setup-project.mdx --- title: setupProject description: API reference for the setupProject method to initialize translation project setup --- ## Overview The `setupProject` method initializes the setup process for a translation project using previously uploaded files. This creates an asynchronous setup job that analyzes the files and prepares them for translation workflows. ```typescript const gt = new GT({ projectId: 'your-project-id', apiKey: 'your-api-key' }); const setupResult = await gt.setupProject(fileRefs, { timeout: 30000 }); console.log(`Setup job created: ${setupResult.jobId}`); ``` You must have previously uploaded the files using [`uploadSourceFiles`](/docs/core/class/methods/translation/upload-source-files) before calling `setupProject`. ## Reference ### Parameters | Name | Type | Description | |------|------|-------------| | `files` | `FileReference[]` | Array of file references from previously uploaded source files | | `options?` | `SetupProjectOptions` | Optional settings for the setup job | #### FileReference Structure ```typescript type FileReference = { fileId: string; versionId: string; branchId: string; fileName: string; fileFormat?: FileFormat; dataFormat?: DataFormat; } ``` #### SetupProjectOptions | Name | Type | Description | |------|------|-------------| | `locales?` | `string[]` | Optional array of target locales | | `timeout?` | `number` | Optional timeout in milliseconds for the API request | ### Returns `Promise` - Contains the setup job identifier and initial status. ```typescript type SetupProjectResult = { jobId: string; status: 'queued'; } ``` | Property | Type | Description | |----------|------|-------------| | `jobId` | `string` | Unique identifier for the setup job | | `status` | `'queued'` | Initial status of the setup job | --- ## Examples ### Basic usage Initialize project setup with uploaded files: ```typescript title="index.ts" copy import { GT } from 'generaltranslation'; const gt = new GT({ projectId: 'your-project-id', apiKey: 'your-api-key' }); // File references from previous upload const fileRefs = [ { fileId: 'file-123', versionId: 'version-456', branchId: 'branch-789', fileName: 'app.json', fileFormat: 'JSON' }, { fileId: 'file-789', versionId: 'version-012', branchId: 'branch-789', fileName: 'content.md', fileFormat: 'MD' } ]; const setupResult = await gt.setupProject(fileRefs); console.log(`Setup initiated with job ID: ${setupResult.jobId}`); // Monitor job status const jobStatus = await gt.checkJobStatus([setupResult.jobId]); console.log(`Job status: ${jobStatus.jobs[0].status}`); ``` --- ## Notes * Files must be uploaded using [`uploadSourceFiles`](/docs/core/class/methods/translation/upload-source-files) before calling `setupProject` * Project setup analyzes file content and structure to optimize translation workflows * The setup job runs asynchronously - monitor progress with [`checkJobStatus`](/docs/core/class/methods/translation/check-job-status) * Setup is typically required before enqueueing translation jobs for new projects * File references include `branchId` for proper versioning with branching support ## Next steps * See [`uploadSourceFiles`](/docs/core/class/methods/translation/upload-source-files) to upload files before setup * See [`checkJobStatus`](/docs/core/class/methods/translation/check-job-status) to monitor setup progress * See [`enqueueFiles`](/docs/core/class/methods/translation/enqueue-files) to start translations after setup