Seamless integration with multiple free translation services for R users.
Ideal for translating text, files, and creating multilingual datasets.
CRAN | Features | Installation | Usage | Contribution
- Overview 🌍
- Features 🚀
- Installation 📦
- Quick Start 🏁
- Usage 💬
- Documentation 📖
- Contribution 🤝
- License ⚖️
- Citation 📝
- Related Projects 🌐
The polyglotr
package is a language translation tool for the R programming language. It provides convenient functions to translate text using different (free) translation services. This vignette will guide you through the usage of the package and demonstrate how to translate text and files in various languages.
Currently, the package has functions to communicate with the following services:
- Google Translate API
- Mymemory API
- Linguee API
- Pons API
- QCRI API
- Wikimedia Translation API
polyglotr
stands out as a versatile and user-friendly translation tool for R users. Here's why you should consider using it:
-
No Authentication Hassle 🔓
- Access multiple translation services without the need for API keys or complex authentication processes.
- Start translating immediately after installation, with no sign-ups or account creation required.
-
Multiple Services, One Package 🌐
- Leverage the power of various translation services (Google, Mymemory, Linguee, Pons, QCRI, Wikimedia) through a single, consistent interface.
- Easily switch between services to compare translations or find the best fit for your needs.
-
R-Native Solution 📊
- Seamlessly integrate translation capabilities into your R workflows and data analysis pipelines.
- Benefit from R's data manipulation strengths while performing translations.
-
Flexibility and Scalability 🚀
- Translate single phrases, large datasets, or entire files with equal ease.
- Create multilingual datasets effortlessly using built-in functions.
-
Open Source and Community-Driven 🤝
- Benefit from continuous improvements and updates driven by user feedback and contributions.
- Adapt the package to your specific needs by accessing and modifying the source code.
-
Comprehensive Documentation 📚
- Get started quickly with extensive documentation, vignettes, and examples.
- Access a wide range of use cases and best practices to maximize your translation efficiency.
By choosing polyglotr, you're opting for a powerful, flexible, and user-friendly translation solution that integrates seamlessly with your R environment, all without the barriers of authentication or service-specific setups.
- Translate text using multiple free translation services
- Batch translation capabilities
- Language detection
- Create translation tables for multiple languages
- File translation
- Easy-to-use interface for different translation APIs
To see which functions are available, please refer to the reference page of the polyglotr
package. The reference page provides a comprehensive list of functions available in the package, organized by category.
Additionally, the package includes vignettes that provide more detailed information on how to use the functions in the package.
To install the package:
# The easiest way is to get polyglotr from CRAN
install.packages("polyglotr")
# Alternatively, install the development version from GitHub
# install.packages("remotes")
remotes::install_github("Tomeriko96/polyglotr")
Here's a minimal example to get you started:
library(polyglotr)
# Translate a simple phrase
text <- "Hello, world!"
translation <- google_translate(text, target_language = "fr")
print(translation)
To demonstrate the usage of the polyglotr
package, let's consider an example where we translate a list of texts into multiple languages using the create_translation_table
function.
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
#> 1 Hello, how are you? ¿Hola, cómo estás?
#> 2 I love programming! ¡Me encanta programar!
#> 3 This is a test. Esto es una prueba.
#> fr de
#> 1 Bonjour comment allez-vous? Hallo, wie geht's dir?
#> 2 J'adore programmer ! Ich liebe Programmieren!
#> 3 C'est un test. Das ist ein Test.
Contributions are welcome! If you'd like to contribute, please:
- Fork the repository
- Create your feature branch (git checkout -b feature/AmazingFeature)
- Commit your changes (git commit -m 'Add some AmazingFeature')
- Push to the branch (git push origin feature/AmazingFeature)
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you use polyglotr in your research, please cite it as follows:
Iwan, T. (2023). polyglotr: Multilingual Text Translation in R. R package version 1.0.0.
https://github.com/Tomeriko96/polyglotr
- googleLanguageR: R client for the Google Translation API, Cloud Natural Language API, Cloud Speech API, and Cloud Text-to-Speech API