shouldSetupProject
API Reference for the shouldSetupProject method to check if project setup is required
Overview
The shouldSetupProject method checks whether a project requires setup before translation jobs can be enqueued.
This method queries the API to determine if the project has been properly initialized and configured for translation workflows.
const gt = new GT({ projectId: 'your-project-id', apiKey: 'your-api-key' });
const result = await gt.shouldSetupProject();
if (result.shouldSetupProject) {
  console.log('Project setup is required');
} else {
  console.log('Project is ready for translations');
}Reference
Parameters
None - this method uses the GT instance configuration to check the project.
Returns
Promise<ShouldSetupProjectResult> - Contains a boolean indicating if setup is required.
type ShouldSetupProjectResult = {
  shouldSetupProject: boolean;
}| Property | Type | Description | 
|---|---|---|
| shouldSetupProject | boolean | trueif project setup is required,falseif already set up | 
Examples
Basic Usage
import { GT } from 'generaltranslation';
const gt = new GT({
  apiKey: 'your-api-key',
  projectId: 'my-project'
});
async function checkProjectStatus() {
  const result = await gt.shouldSetupProject();
  
  if (result.shouldSetupProject) {
    console.log('Project needs setup');
    return 'setup-required';
  } else {
    console.log('Project is ready for translations');
    return 'ready';
  }
}
const status = await checkProjectStatus();Notes
- The result determines whether setupProjectneeds to be called
- Projects typically need setup when they're newly created or when significant structural changes are made
Next Steps
- See setupProjectto perform setup if required
- See checkSetupStatusto monitor setup progress
- See enqueueFilesto start translations after setup
- See uploadSourceFilesto upload files before setup
How is this guide?

