translate_swirl: Translate Swirl YAML to another language

Description Usage Arguments Value Examples

View source: R/translate_swirl.R

Description

Translate Swirl YAML to another language

Usage

1
2
3
4
5
6
7
8
translate_swirl(
  file,
  outfile = tempfile(fileext = ".yml"),
  target = "es",
  detect = TRUE,
  verbose = TRUE,
  ...
)

Arguments

file

YAML file for Swirl lesson

outfile

output YAML file for translated Swirl lesson

target

language to translate to, see gl_translate

detect

Should gl_detect_file be run to check that the language is not currently the target? Must be google Language authorized using gl_auth

verbose

Print diagnostic messages

...

additional options to pass to yaml::write_yaml

Value

A filename of the output file. The attribute target_language is also given to the filename.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
x = c("- Class: meta",
"  Course: Test Class", "  Lesson: Test lesson",
"  Author: Shannon Ellis", "", "- Class: text",
"  Output: This is an example with code `df`.")
tfile = tempfile(fileext = ".yml")
writeLines(x, tfile)
translate_swirl(tfile, outfile = tfile)
readLines(tfile)

## End(Not run)

muschellij2/didactr documentation built on March 17, 2021, 12:45 p.m.