---
title: "translate(text:from:)"
framework: browserenginekit
role: symbol
role_heading: Instance Method
path: "browserenginekit/betextinteraction/translate(text:from:)"
---

# translate(text:from:)

Presents a translation of the text.

## Declaration

```swift
func translate(text: String, from presentationRect: CGRect)
```

## Parameters

- `text`: The text to translate.
- `presentationRect`: The area in the text input view in which the text appears, which the system uses to locate the translation UI.

## See Also

### Translation and transliteration

- [transliterateChinese(forText:)](browserenginekit/betextinteraction/transliteratechinese(fortext:).md)
