Learn R Programming

deepRstudio (version 0.0.9)

deepel_from_EN: Translate English Text to Other Languages via DeepL API

Description

Translate English text from the clipboard into the specified target language using the DeepL API.

Usage

deepel_from_EN(
  target_lang = "JA",
  Auth_Key = Sys.getenv("DeepL_API_KEY"),
  free_mode = TRUE
)

Value

The translated text is placed into the clipboard and the function returns the result of clipr::write_clip.

Arguments

target_lang

The language into which the text should be translated. Options are: BG - Bulgarian, CS - Czech, DA - Danish, DE - German, EL - Greek, EN - English (unspecified variant for backward compatibility; please select EN-GB or EN-US instead), EN-GB - English (British), EN-US - English (American), ES - Spanish, ET - Estonian, FI - Finnish, FR - French, HU - Hungarian, ID - Indonesian, IT - Italian, JA - Japanese, KO - Korean, LT - Lithuanian, LV - Latvian, NB - Norwegian (Bokmål), NL - Dutch, PL - Polish, PT - Portuguese (unspecified variant for backward compatibility; please select PT-BR or PT-PT instead), PT-BR - Portuguese (Brazilian), PT-PT - Portuguese (all Portuguese varieties excluding Brazilian Portuguese), RO - Romanian, RU - Russian, SK - Slovak, SL - Slovenian, SV - Swedish, TR - Turkish, UK - Ukrainian, ZH - Chinese (simplified). assertthat::is.string(target_lang)

Auth_Key

The authentication key for the DeepL API.

free_mode

A logical value indicating whether to use the free or paid DeepL API. Default is TRUE.

Author

Satoshi Kume

Details

Translate English Text to Other Languages via DeepL API

This function takes English text from the clipboard and translates it into the specified target language using the DeepL API. The translated text is then placed back into the clipboard, ready to be pasted wherever needed.

Examples

Run this code
if (FALSE) {

#Copy English text into your clipboard to excute the function. Then paste your clipboard.
deepel_from_EN(target_lang = 'JA')

}

Run the code above in your browser using DataLab