MyNixOS website logo
Description
Seamless Language Translation in 'RStudio' using 'DeepL' API and 'Rstudioapi'
Enhancing cross-language compatibility within the 'RStudio' environment and supporting seamless language understanding, the 'deepRstudio' package leverages the power of the 'DeepL' API (see <https://www.deepl.com/docs-api>) to enable seamless, fast, accurate, and affordable translation of code comments, documents, and text. This package offers the ability to translate selected text into English (EN), as well as from English into various languages, namely Japanese (JA), Chinese (ZH), Spanish (ES), French (FR), Russian (RU), Portuguese (PT), and Indonesian (ID). With much of the text being written in English, the emphasis is on compatibility from English. It is also designed for developers working on multilingual projects and data analysts collaborating with international teams, simplifying the translation process and making code more accessible and comprehensible to people with diverse language backgrounds. This package uses the 'rstudioapi' package and 'DeepL' API, and is simply implemented, executed from addins or via shortcuts on 'RStudio'. With just a few steps, content can be translated between supported languages, promoting better collaboration and expanding the global reach of work. The functionality of this package works only on 'RStudio' using 'rstudioapi'.

deepRstudio: Seamless Language Translation in RStudio using DeepL API and rstudioapi

Lifecycle:maturing CRAN CRAN_latest_release_date CRAN :total status badge deepRstudio status badge

GitHub/deepRstudio

Description

Enhancing cross-language compatibility within the RStudio environment and supporting seamless language understanding, the deepRstudio package leverages the power of the 'DeepL' API (see https://www.deepl.com/docs-api) to enable seamless, fast, accurate, and affordable translation of code comments, documents, and text. This package offers the ability to translate selected text into English, as well as from English (EN) into various languages, namely Japanese (JA), Chinese (ZH), Spanish (ES), French (FR), Russian (RU), Portuguese (PT), and Indonesian (ID). With much of the text being written in English, the emphasis is on compatibility from English. It is also designed for developers working on multilingual projects and data analysts collaborating with international teams, simplifying the translation process and making code more accessible and comprehensible to people with diverse language backgrounds. This package uses 'rstudioapi' package and 'DeepL' API, and is simply implemented, executed from addins or via shortcuts on RStudio. With just a few steps, content can be translated between supported languages, promoting better collaboration and expanding the global reach of work.

The functionality of this package works only on RStudio using rstudioapi.

DeepL API Docs : https://www.deepl.com/docs-api

To obtain your DeepL API key, you must register for an account at the DeepL website. You can register for a free account. This package is built for use with the free version of the Web API.

Demo video

Installation of the deepRstudio package

1. Start R / RStudio console.

2. Run the following commands in the R console:

CRAN-version installation

# CRAN-version installation
install.packages("deepRstudio")
library(deepRstudio)

Note: Once restart R (Restart R on the Session or .rs.restartR()) is recommended.

Dev-version installation

#v0.0.5
devtools::install_github("kumeS/deepRstudio", ref = "v0.0.5")
library(deepRstudio)

Note: Once restart R (Restart R on the Session or .rs.restartR()) is recommended.

3. Set the API key according to DeepL Web API.

Please register for a membership (either free or paid) on the DeepL website (https://www.deepl.com/docs-api) to obtain your API key.

Step 1: log in to the DeepL website.

GitHub Logo1

Step 2: click on the Account item.

GitHub Logo2

Step 3: Scroll down in the Account section and you will see your DeepL API key.

GitHub Logo3

Note: DeepL API Free plan offers free translation of up to 500,000 words/characters per month.

# Set your key for the DeepL API
Sys.setenv(DeepL_API_KEY = "Your API key")

Create an .Rprofile file in your home directory and add your API key (using the code above) into it.

# Create a file
file.create("~/.Rprofile") 

# [MacOS X] Open the file and edit it
system(paste("open ~/.Rprofile"))

Note: Please be aware of newline character inconsistencies across different operating systems.

Here is an example of .Rprofile configuration.

GitHub Logo1

Functions in deepRstudio

FunctionDescriptionScript
deepelDeepL Translation FunctionScript
deepel_from_ENTranslate English Text to Other Languages via DeepL API in your clipboardScript
deepel_rstudioapi_2ENTranslate Selected Text to English via DeepL API (as RStudio Addins)Script
deepel_rstudioapi_2ZHTranslate Selected Text to Chinese via DeepL API (as RStudio Addins)Script
deepel_rstudioapi_2ESTranslate Selected Text to Spanish via DeepL API (as RStudio Addins)Script
deepel_rstudioapi_2FRTranslate Selected Text to French via DeepL API (as RStudio Addins)Script
deepel_rstudioapi_2RUTranslate Selected Text to Russian via DeepL API (as RStudio Addins)Script
deepel_rstudioapi_2PTTranslate Selected Text to Portuguese (all Portuguese varieties mixed) via DeepL API (as RStudio Addins)Script
deepel_rstudioapi_2IDTranslate Selected Text to Indonesian via DeepL API (as RStudio Addins)Script
deepel_rstudioapi_2JATranslate Selected Text to Japanese via DeepL API (as RStudio Addins)Script
deepel_rstudioapi_speakInJATranslate and Speak in Japanese via DeepL API (as RStudio Addins / MacOS X)Script

License

Copyright (c) 2023 Satoshi Kume. Released under the Artistic License 2.0.

Cite

Kume S. (2023) deepRstudio: Seamless Language Translation in RStudio using DeepL API and rstudioapi

#BibTeX
@misc{Kume2023deepRstudio,
  title={deepRstudio: Seamless Language Translation in RStudio using DeepL API and rstudioapi},
  author={Kume, Satoshi}, year={2023},
  publisher={GitHub}, note={R Package},
  howpublished={\url{https://github.com/kumeS/deepRstudio}},
}

Contributors

  • Satoshi Kume.
Metadata

Version

0.0.9

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows