---
title: "Translate language"
section: "frontend/predictions"
platforms: ["angular", "javascript", "nextjs", "react", "react-native", "vue"]
gen: 2
last-updated: "2026-03-25T17:40:00.000Z"
url: "https://docs.amplify.aws/react/frontend/predictions/translate/"
---

export async function getStaticPaths() {
  return getCustomStaticPath(meta.platforms);
}

<Callout informational>

**Note:** Make sure to complete the [getting started](/[platform]/build-a-backend/add-aws-services/predictions/set-up-predictions/) section first, where you will set up the IAM roles with the right policy actions

</Callout>

## Working with the API

Translate text from one source language to a destination language.

```ts
import { Predictions } from '@aws-amplify/predictions';

const result = await Predictions.convert({
  translateText: {
    source: {
      text: textToTranslate,
      language : "es"
    },
    targetLanguage: "en"
  }
})
```

To view the complete list of supported languages refer to [Supported languages and language codes](https://docs.aws.amazon.com/translate/latest/dg/what-is-languages.html).
