polyglotr

polyglotr

R-CMD-check CRAN status CRAN last month downloads CRAN downloads The diffify page for the R package polyglotr Shiny App Deployed

R package for text translation via free APIs — no API keys needed for most services.

Supports Google Translate, Apertium, MyMemory, PONS, QCRI, and Wikimedia Translation.

Installation

install.packages("polyglotr")

# development version
remotes::install_github("Tomeriko96/polyglotr")

Usage

library(polyglotr)

google_translate("Hello, world!", target_language = "fr")

apertium_translate("Hello, world!", target_language = "es", source_language = "en")

Translate multiple texts into multiple languages at once:

texts <- c("Hello, how are you?", "I love programming!", "This is a test.")
languages <- c("es", "fr", "de")

create_translation_table(texts, languages)

#>        Original_word                     es                          fr                       de
#> 1 Hello, how are you?     ¿Hola, cómo estás? Bonjour comment allez-vous?   Hallo, wie geht's dir?
#> 2 I love programming! ¡Me encanta programar!        J'adore programmer ! Ich liebe Programmieren!
#> 3     This is a test.    Esto es una prueba.              C'est un test.        Das ist ein Test.

See the reference page for all functions and the vignettes for detailed examples.

Shiny App

Shiny App Deployed

A web UI for non-R users. Requires shiny, shinydashboard, and DT.

launch_polyglotr_app()

Contributing

PRs welcome. Fork, branch, and open a pull request against main.

License

MIT — see LICENSE.

Citation

Iwan, T. (2023). polyglotr: Multilingual Text Translation in R.
https://github.com/Tomeriko96/polyglotr