This R package allows you to translate text directly from R: from dataframes to strings, it lets you to use common translations engines like Google Translate using a frontend, which it is a benefit in terms of privacy.
For now, these are the supported ones:
- SimplyTranslate. It supports Google Translate, Reverso and inCIBA.
- Lingva. It supports Google Translate.
- gtranslate. Lightweight frontend for Google Translate. You can selfhost it with my Docker image.
- Mozhi. Fork of SimplyTranslate, now supports more features and translation engines, such as Deepl, LibreTranslate or DuckDuckGo.
- Translate texts, strings of R objects without leaving R using frontends for Google Translate or Reverso.
- Automatically detect languages.
- Get a list of available languages.
This package is not yet available on CRAN, so you must install from GitHub using remotes
package.
if (!require("remotes")) install.packages("remotes")
remotes::install_github("myanesp/opentranslatr")
# And then load into your current session
library(opentranslatr)
lingva(from = "es", to = "fr", str = "hola, ¿cómo estamos?")
[1] "Bonjour, comment allez-vous?"
simplytranslate(from = "en", to = "de", str = "welcome!")
[1] "Willkommen!"
simplytranslate(from = "en", to = "fr", str = "welcome!", engine = "reverso") # select engine
[1] "bienvenue!"
mozhi(from = "en", to = "de", str = "beach", instance = "http://localhost:3000")
[1] "Strand"
gtrannslate(from = "en", to = "es", str = "table")
[1] "mesa"
get_languages() # Get available languagues for the frontend you choose
get_mozhi_engines() # Get available languages for the Mozhi instance you choose