View source: R/google_translate_long_text.R
google_translate_long_text | R Documentation |
This function translates long text from one language to another using Google Translate. It splits the text into smaller chunks if necessary to handle large inputs.
google_translate_long_text(
text,
target_language = "en",
source_language = "auto",
chunk_size = 1000
)
text |
The long text to translate. Should be a single string. |
target_language |
The language to translate the text into. Default is "en" for English. |
source_language |
The language of the input text. Default is "auto" for automatic detection. |
chunk_size |
The maximum number of characters to send in a single translation request. Default is 1000. |
A single string containing the translated text.
## Not run:
long_text <- paste(rep("This is a long text to translate.", 100), collapse = " ")
google_translate_long_text(
long_text, target_language = "de",
source_language = "en",
chunk_size = 500)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.