GT ClassMethodsTranslation

setupProject

API reference for the setupProject method to initialise a translation project

Overview

The setupProject method initialises the setup process for a translation project using previously uploaded files. This creates an asynchronous setup job that analyses the files and prepares them for translation workflows.

const gt = new GT({ projectId: 'your-project-id', apiKey: 'your-api-key' });

const setupResult = await gt.setupProject(fileRefs, 30000);
console.log(`Setup job created: ${setupResult.setupJobId}`);

You must have uploaded the files beforehand using uploadSourceFiles before calling setupProject.

Reference

Parameters

NameTypeDescription
filesFileUploadRef[]Array of file references from previously uploaded source files
timeoutMs?numberOptional timeout in milliseconds for the API request

FileUploadRef Structure

type FileUploadRef = {
  fileId: string;
  versionId: string;
  fileName: string;
  fileFormat?: FileFormat;
  dataFormat?: DataFormat;
}

Returns

Promise<SetupProjectResult> – Contains the setup job identifier and initial status.

type SetupProjectResult = {
  setupJobId: string;
  status: 'queued';
}
PropertyTypeDescription
setupJobIdstringUnique identifier for the setup job
status'queued'Initial status of the setup job

Examples

Basic usage

Initialise the project setup with uploaded files:

index.ts
import { GT } from 'generaltranslation';

const gt = new GT({
  projectId: 'your-project-id',
  apiKey: 'your-api-key'
});

// File references from the previous upload
const fileRefs = [
  {
    fileId: 'file-123',
    versionId: 'version-456',
    fileName: 'app.json',
    fileFormat: 'JSON'
  },
  {
    fileId: 'file-789',
    versionId: 'version-012',
    fileName: 'content.md',
    fileFormat: 'MD'
  }
];

const setupResult = await gt.setupProject(fileRefs);
console.log(`Setup initiated with job ID: ${setupResult.setupJobId}`);

Notes

  • Files must be uploaded using uploadSourceFiles before calling setupProject
  • Project setup analyses file content and structure to optimise translation workflows
  • The setup job runs asynchronously — monitor progress with checkSetupStatus
  • Setup is typically required before enqueuing translation jobs for new projects

Next steps

How is this guide?

setupProject