translate_slide: Translate Google Slide Text to Another Language

Description Usage Arguments Value Note Examples

View source: R/translate_slides.R

Description

Translate Google Slide Text to Another Language

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
translate_slide(id, target = "es", detect = TRUE, verbose = TRUE, ...)

copy_and_translate_slide(
  id,
  gs_name = NULL,
  trash_same_gs_name = FALSE,
  share = FALSE,
  target = "es",
  detect = TRUE,
  verbose = TRUE,
  ...
)

Arguments

id

Google Slide ID, usually from drive_ls

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

...

arguments passed to check_didactr_auth

gs_name

Name of new Google slide deck

trash_same_gs_name

Should other Google slide decks with the same name be trashed before copying? If not, can fill up your drive.

share

should the link sharing be turned on?

Value

A list of results from commit_to_slides

Note

Copies are put in the didactr_translations folder in your Google Drive.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 
library(googledrive)
check_didactr_auth()
# id = "147UQaZBB5RoTpzsNiqkqEr4N8fcHBMB6eNr_5IdksRk"
info = drive_find("datatables", n_max = 2000, type = "presentation")
info = info[grepl("^06" ,info$name), ]
if (nrow(info) > 0) {
info = info[1,]
xid = drive_cp(info, name = paste0("Translated ",
info$name))
id = xid
translated = translate_slide(id, target = "es")
drive_trash(id)
}


## End(Not run)
## Not run: 
check_didactr_auth()
id = "1Opt6lv7rRi7Kzb9bI0u3SWX1pSz1k7botaphTuFYgNs"
res = copy_and_translate_slide(id)
googledrive::drive_trash(res$id)

## End(Not run)

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