# General Translation Platform: TranslateManyResult
URL: https://generaltranslation.com/en-US/docs/platform/core/reference/types/translate-many-result.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Result array returned by batch translation. API reference for TranslateManyResult type.

`TranslateManyResult` is the value returned by [`translateMany`](/docs/platform/core/reference/gt-class-methods/translation/translate-many). It is an array of [`TranslationResult`](/docs/platform/core/reference/types/translation-result) objects in the same order as the input entries.

## Overview [#overview]

`TranslateManyResult` is an array of translation results. Each element is either a success or an error, discriminated by its `success` property.

```typescript
type TranslateManyResult = TranslationResult[];
```

Each element follows the [`TranslationResult`](/docs/platform/core/reference/types/translation-result) shape:

```typescript
type TranslationResult = RequestSuccess | TranslationError;

type RequestSuccess = TypedResult & {
  success: true;
  locale: string;
};

type TranslationError = {
  success: false;
  error: string;
  code: number;
};
```

## Example [#example]

```typescript
import { GT } from 'generaltranslation';
import { TranslateManyResult } from 'generaltranslation/types';

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

const results: TranslateManyResult = await gt.translateMany(
  ['Hello', 'Goodbye'],
  'es'
);
```

```typescript
// Narrow each element on the success property
results.forEach((result, index) => {
  if (result.success) {
    console.log(`Entry ${index}: ${result.translation}`);
  } else {
    console.error(`Entry ${index} failed: ${result.error}`);
  }
});
```

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
