> ## Documentation Index
> Fetch the complete documentation index at: https://assemblyai.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Translate an AssemblyAI Subtitle Transcript

In this guide, we'll show you how to translate an AssemblyAI generated subtitle transcript. We will also be using the `Googletrans` Python library to implement the Google Translate API.

## Get Started

Before we begin, make sure you have an AssemblyAI account and an API key. You can [sign up](https://assemblyai.com/dashboard/signup) for a free account and get your API key from your dashboard.

## Step-by-Step Instructions

Install the relevant packages.

1. AssemblyAI SDK
2. Googletrans

```bash theme={null}
pip install -U assemblyai googletrans
```

Import the `assemblyai` package and set the API key. Import `Translator` class from `googletrans` package.

```python theme={null}
import assemblyai as aai
from googletrans import Translator

aai.settings.api_key = "YOUR_API_KEY"
```

Create a `Transcriber` object.

```python theme={null}
config = aai.TranscriptionConfig()
transcriber = aai.Transcriber()
```

Create a `Translator` object.

```python theme={null}
translator = Translator()
```

Use the Transcriber object's `transcribe` method and pass in the audio file's path as a parameter. The transcribe method saves the results of the transcription to the `Transcriber` object's `transcript` attribute.

```python theme={null}
transcript = transcriber.transcribe("./my-audio.mp3", config)
```

Alternatively, you can pass in a path to an audio file saved on the internet.

```python theme={null}
transcript = transcriber.transcribe("https://example.org/audio.mp3", config)
```

Export SRT subtitles with the `export_subtitles_srt` method. Create a `subtitle_transcript` variable to translate in the next step.

```python theme={null}
subtitle_transcript = transcript.export_subtitles_srt()
```

Translate subtitle transcript to target language

```python theme={null}
translation = translator.translate(subtitle_transcript, dest='es')
```

Print results

```python theme={null}
print(translation.text)
```

## Conclusion

Using the subtitles and transcripts generated by AssemblyAI, we can also generate translated alternatives using other translation APIs. The implementation logic will be similar with other solutions like DeepL, Yandex Translate and many more.

To translate to other languages, find the full list of Supported Languages in the **Further Documentations** section.

## Further Documentation

[Googletrans Library](https://pypi.org/project/googletrans/)

[Translation Supported Languages](https://py-googletrans.readthedocs.io/en/latest/#googletrans-languages)
