Learn R Programming

polyglotr (version 1.5.2)

translate_file: Translate File

Description

Translates the content of a file using Google Translate API.

Usage

translate_file(
  file_path,
  target_language = "en",
  source_language = "auto",
  overwrite = FALSE
)

Arguments

file_path

The path to the file to be translated.

target_language

The target language to translate the file content to. Default is "en".

source_language

The source language of the file content. Default is "auto".

overwrite

Logical indicating whether to overwrite the original file with the translated content. Default is FALSE.

Examples

Run this code
if (FALSE) {
translate_file("path/to/file.txt", target_language = "fr", source_language = "en", overwrite = TRUE)
}

Run the code above in your browser using DataLab