---
title: "translate"
sidebar_label: "translate"
description: "Kotlin binding reference: translate."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.modelverse](../index.md)/[TranslateModel](index.md)/[translate](translate.md)

# translate

[common]\
fun [translate](translate.md)(texts: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)&gt;, sourceLanguage: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?, targetLanguage: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), options: [TranslateOptions](../TranslateOptions/index.md), listener: [TranslateListener](../TranslateListener/index.md)): [TranslateHandle](../TranslateHandle/index.md)

Translate [texts](translate.md) from [sourceLanguage](translate.md) (null keeps the model's default source) into [targetLanguage](translate.md), both codes from [Capabilities.languages](../Capabilities/languages.md), under [options](translate.md). Returns at once; the worker runs the batch and calls [listener](translate.md) on its thread: [TranslateListener.onTranslations](../TranslateListener/onTranslations.md) with one translation per text in order, then [TranslateListener.onDone](../TranslateListener/onDone.md). An empty list or a code the model does not name ends in [TranslateListener.onError](../TranslateListener/onError.md).