gl_translate_detect: Detect the language of text within a request

View source: R/translate.R

gl_translate_detectR Documentation

Detect the language of text within a request

Description

Detect the language of text within a request

Usage

gl_translate_detect(string)

Arguments

string

Character vector of text to detect language for

Details

Consider using library(cld2) and cld2::detect_language instead for offline detection, since that is free and does not require an API call.

gl_translate also returns a detection of the language, so you could optionally use that in one step.

Value

A tibble of the detected languages with columns confidence, isReliable, language, and text, of length equal to the vector of text you passed in.

See Also

https://cloud.google.com/translate/docs/reference/detect

Other translations: gl_translate(), gl_translate_document(), gl_translate_languages()

Examples

## Not run: 
gl_translate_detect("katten sidder på måtten")

## End(Not run)

googleLanguageR documentation built on Aug. 25, 2025, 1:12 a.m.