| Title: | Interface to the 'DeepL' Translation API |
|---|---|
| Description: | A wrapper for the 'DeepL' API <https://developers.deepl.com/docs>, a web service for translating texts between different languages. A DeepL API developer account is required to use the service (see <https://www.deepl.com/pro#developer>). |
| Authors: | David Zumbach [aut, cre], Paul C. Bauer [aut] |
| Maintainer: | David Zumbach <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 2.1.0 |
| Built: | 2026-10-09 08:36:26 UTC |
| Source: | https://github.com/zumbov2/deeplr |
deeplr packageAn R wrapper for the DeepL Translator API
See the README on GitHub
Maintainer: David Zumbach [email protected]
Authors:
Paul C. Bauer [email protected]
Useful links:
available_languages returns a list of all languages supported by the DeepL API Pro.
available_languages(auth_key)available_languages(auth_key)
auth_key |
A string representing the authentication key for the DeepL API Pro.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Pro account at DeepL API Pro. The function makes an API call to retrieve the list of supported languages and returns them in a structured format.
DeepL API Documentation on Supported Languages
## Not run: available_languages() ## End(Not run)## Not run: available_languages() ## End(Not run)
available_languages2 returns a list of all languages supported by the DeepL API Free.
available_languages2(auth_key)available_languages2(auth_key)
auth_key |
A string representing the authentication key for the DeepL API Free.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Free account at DeepL API Free. The function makes an API call to retrieve the list of supported languages and returns them in a structured format.
DeepL API Documentation on Supported Languages
## Not run: available_languages2() ## End(Not run)## Not run: available_languages2() ## End(Not run)
create_glossary creates a glossary for a language pair using the DeepL API Pro.
create_glossary( name, source_lang, target_lang, entries_source_lang, entries_target_lang, return_tibble = F, auth_key )create_glossary( name, source_lang, target_lang, entries_source_lang, entries_target_lang, return_tibble = F, auth_key )
name |
A string specifying the name to be associated with the glossary. |
source_lang |
A string specifying the source language code. |
target_lang |
A string specifying the target language code. |
entries_source_lang |
A character vector containing the glossary entries in the source language. |
entries_target_lang |
A character vector containing the glossary entries in the target language. |
return_tibble |
Logical. If |
auth_key |
A string representing the authentication key for the DeepL API Pro.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Pro account at DeepL API Pro. The function sends a request to create a glossary and returns the result in a structured format.
DeepL API Documentation on Glossaries
## Not run: glossary_english <- c("Hello", "Goodbye") glossary_swiss_german <- c("Grüezi", "Adiöö") create_glossary( name = "My Glossary", source_lang = "en", target_lang = "de", entries_source_lang = glossary_english, entries_target_lang = glossary_swiss_german ) ## End(Not run)## Not run: glossary_english <- c("Hello", "Goodbye") glossary_swiss_german <- c("Grüezi", "Adiöö") create_glossary( name = "My Glossary", source_lang = "en", target_lang = "de", entries_source_lang = glossary_english, entries_target_lang = glossary_swiss_german ) ## End(Not run)
create_glossary2 creates a glossary for a language pair using the DeepL API Free.
create_glossary2( name, source_lang, target_lang, entries_source_lang, entries_target_lang, return_tibble = F, auth_key )create_glossary2( name, source_lang, target_lang, entries_source_lang, entries_target_lang, return_tibble = F, auth_key )
name |
A string specifying the name to be associated with the glossary. |
source_lang |
A string specifying the source language code. |
target_lang |
A string specifying the target language code. |
entries_source_lang |
A character vector containing the glossary entries in the source language. |
entries_target_lang |
A character vector containing the glossary entries in the target language. |
return_tibble |
Logical. If |
auth_key |
A string representing the authentication key for the DeepL API Free.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Free account at DeepL API Free. The function sends a request to create a glossary and returns the result in a structured format.
DeepL API Documentation on Glossaries
## Not run: glossary_english <- c("Hello", "Goodbye") glossary_swiss_german <- c("Grüezi", "Adiöö") create_glossary2( name = "My Glossary", source_lang = "en", target_lang = "de", entries_source_lang = glossary_english, entries_target_lang = glossary_swiss_german ) ## End(Not run)## Not run: glossary_english <- c("Hello", "Goodbye") glossary_swiss_german <- c("Grüezi", "Adiöö") create_glossary2( name = "My Glossary", source_lang = "en", target_lang = "de", entries_source_lang = glossary_english, entries_target_lang = glossary_swiss_german ) ## End(Not run)
delete_glossary deletes a glossary from your DeepL API Pro account using its unique ID.
delete_glossary(glossary_id, auth_key)delete_glossary(glossary_id, auth_key)
glossary_id |
A string specifying the unique ID of the glossary to be deleted. |
auth_key |
A string representing the authentication key for the DeepL API Pro.
If not provided, the function will attempt to retrieve the key from the environment
variable |
Deleting a glossary is permanent and cannot be undone. If needed, you can back up
glossary entries in advance using get_glossary_entries.
To use this function, you must obtain an authentication key by registering for a DeepL API Pro account at DeepL API Pro.
For a list of available glossaries and their metadata, see list_glossaries.
No return value. A confirmation message is printed upon successful deletion.
DeepL API Documentation on Glossary Deletion
## Not run: glossary_id <- "example-glossary-id" delete_glossary(glossary_id) ## End(Not run)## Not run: glossary_id <- "example-glossary-id" delete_glossary(glossary_id) ## End(Not run)
delete_glossary2 deletes a glossary from your DeepL API Free account using its unique ID.
delete_glossary2(glossary_id, auth_key)delete_glossary2(glossary_id, auth_key)
glossary_id |
A string specifying the unique ID of the glossary to be deleted. |
auth_key |
A string representing the authentication key for the DeepL API Free.
If not provided, the function will attempt to retrieve the key from the environment
variable |
Deleting a glossary is permanent and cannot be undone. If needed, you can back up
glossary entries in advance using get_glossary_entries2.
To use this function, you must obtain an authentication key by registering for a DeepL API Free account at DeepL API Free.
For a list of available glossaries and their metadata, see list_glossaries2.
No return value. A confirmation message is printed upon successful deletion.
DeepL API Documentation on Glossary Deletion
## Not run: glossary_id <- "example-glossary-id" delete_glossary2(glossary_id) ## End(Not run)## Not run: glossary_id <- "example-glossary-id" delete_glossary2(glossary_id) ## End(Not run)
detect identifies the language of a given text using the DeepL API Pro.
detect(text, auth_key)detect(text, auth_key)
text |
A character vector containing the texts to classify. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
auth_key |
A string representing the authentication key for the DeepL API Pro.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Pro account at
DeepL API Pro. This service may incur costs depending on the number of
characters submitted. To view all supported languages, use available_languages.
## Not run: detect("My name is Hans.") ## End(Not run)## Not run: detect("My name is Hans.") ## End(Not run)
detect2 identifies the language of a given text using the DeepL API Free.
detect2(text, auth_key)detect2(text, auth_key)
text |
A character vector containing the texts to classify. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
auth_key |
A string representing the authentication key for the DeepL API Free.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Free account at
DeepL API Free. With the Free API, you can translate or detect up to
500,000 characters per month at no cost. To view all supported languages, use available_languages2.
## Not run: detect2("My name is Hans.") ## End(Not run)## Not run: detect2("My name is Hans.") ## End(Not run)
get_glossary_entries retrieves all term pairs from a specified glossary using the DeepL API Pro.
For a list of available glossaries, see list_glossaries.
get_glossary_entries(glossary_id, auth_key)get_glossary_entries(glossary_id, auth_key)
glossary_id |
A string specifying the unique ID of the glossary whose entries you want to retrieve. |
auth_key |
A string representing the authentication key for the DeepL API Pro.
If not provided, the function will attempt to retrieve the key from the environment
variable |
Glossaries are custom dictionaries consisting of source-target term pairs. The DeepL API returns these entries as tab-separated values (TSV). This function parses and converts them into a tidy tibble for further analysis.
To use this function, you must obtain an authentication key by registering for a DeepL API Pro account at DeepL API Pro.
A tibble with two columns representing the source and target language terms. Column names are automatically inferred from the glossary's language pair.
DeepL API Documentation — Get Glossary Entries
## Not run: glossary_id <- "your-glossary-id" entries <- get_glossary_entries(glossary_id) ## End(Not run)## Not run: glossary_id <- "your-glossary-id" entries <- get_glossary_entries(glossary_id) ## End(Not run)
get_glossary_entries2 retrieves all term pairs from a specified glossary using the DeepL API Free.
For a list of available glossaries, see list_glossaries2.
get_glossary_entries2(glossary_id, auth_key)get_glossary_entries2(glossary_id, auth_key)
glossary_id |
A string specifying the unique ID of the glossary whose entries you want to retrieve. |
auth_key |
A string representing the authentication key for the DeepL API Free.
If not provided, the function will attempt to retrieve the key from the environment
variable |
Glossaries are custom dictionaries consisting of source-target term pairs. The DeepL API returns these entries as tab-separated values (TSV). This function parses and converts them into a tidy tibble for further analysis.
To use this function, you must obtain an authentication key by registering for a DeepL API Free account at DeepL API Free.
A tibble with two columns representing the source and target language terms. Column names are automatically inferred from the glossary's language pair.
DeepL API Documentation — Get Glossary Entries
## Not run: glossary_id <- "your-glossary-id" entries <- get_glossary_entries2(glossary_id) ## End(Not run)## Not run: glossary_id <- "your-glossary-id" entries <- get_glossary_entries2(glossary_id) ## End(Not run)
list_glossaries retrieves a list of all glossaries and their metadata associated with your DeepL API Pro account.
Note that glossary entries themselves are not included.
list_glossaries(auth_key)list_glossaries(auth_key)
auth_key |
A string representing the authentication key for the DeepL API Pro.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Pro account at DeepL API Pro.
DeepL API Documentation on Glossaries
## Not run: list_glossaries() ## End(Not run)## Not run: list_glossaries() ## End(Not run)
list_glossaries2 retrieves a list of all glossaries and their metadata associated with your DeepL API Free account.
Note that glossary entries themselves are not included.
list_glossaries2(auth_key)list_glossaries2(auth_key)
auth_key |
A string representing the authentication key for the DeepL API Free.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Free account at DeepL API Free.
DeepL API Documentation on Glossaries
## Not run: list_glossaries2() ## End(Not run)## Not run: list_glossaries2() ## End(Not run)
pimp translates a text into a helper language and then back to the original language
using the DeepL API Pro. This method can be used to refine or rephrase text automatically.
pimp(text, source_lang, help_lang, auth_key)pimp(text, source_lang, help_lang, auth_key)
text |
A character vector containing the texts to be improved. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language of the input text. If of length 1, the same language is applied to all elements. |
help_lang |
A string specifying the helper language used for the intermediate translation. |
auth_key |
A string representing the authentication key for the DeepL API Pro.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Pro account at
DeepL API Pro. This service may incur costs based on the number
of translated characters. To view all supported languages, use available_languages.
DeepL API Documentation on Translation
## Not run: pimp( "In former times I lived in Zurich", source_lang = "EN", help_lang = "DE" ) ## End(Not run)## Not run: pimp( "In former times I lived in Zurich", source_lang = "EN", help_lang = "DE" ) ## End(Not run)
pimp2 translates a text into a helper language and then back to the original language
using the DeepL API Free. This method can be used to refine or rephrase text automatically.
pimp2(text, source_lang, help_lang, auth_key)pimp2(text, source_lang, help_lang, auth_key)
text |
A character vector containing the texts to be improved. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language of the input text. If of length 1, the same language is applied to all elements. |
help_lang |
A string specifying the helper language used for the intermediate translation. |
auth_key |
A string representing the authentication key for the DeepL API Free.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Free account at
DeepL API Free. With the Free API, you can translate up to
500,000 characters per month at no cost. To view all supported languages, use available_languages2.
DeepL API Documentation on Translation
## Not run: pimp2( text = "In former times I lived in Zurich", source_lang = "EN", help_lang = "DE" ) ## End(Not run)## Not run: pimp2( text = "In former times I lived in Zurich", source_lang = "EN", help_lang = "DE" ) ## End(Not run)
split_text divides input text into smaller segments that do not exceed a specified maximum size in bytes.
Segmentation is based on sentence or word boundaries.
split_text(text, max_size_bytes = 29000, tokenize = "sentences")split_text(text, max_size_bytes = 29000, tokenize = "sentences")
text |
A character vector containing the text(s) to be split. |
max_size_bytes |
An integer specifying the maximum size (in bytes) for each segment. |
tokenize |
A string indicating the level of tokenization. Must be either |
This function uses tokenizers::tokenize_sentences (or tokenize_words if specified)
to split the text into natural language segments before assembling byte-limited blocks.
A tibble with one row per text segment, containing the following columns:
text_id: The index of the original text in the input vector.
segment_id: A sequential ID identifying the segment number.
segment_text: The resulting text segment, each within the specified byte limit.
## Not run: long_text <- paste0(rep("This is a very long text. ", 10000), collapse = "") split_text(long_text, max_size_bytes = 1000, tokenize = "sentences") ## End(Not run)## Not run: long_text <- paste0(rep("This is a very long text. ", 10000), collapse = "") split_text(long_text, max_size_bytes = 1000, tokenize = "sentences") ## End(Not run)
supported_glossary_language_pairs lists all language pairs supported for glossary creation
in the DeepL API Pro.
supported_glossary_language_pairs(auth_key)supported_glossary_language_pairs(auth_key)
auth_key |
A string representing the authentication key for the DeepL API Pro.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Pro account at DeepL API Pro.
DeepL API Documentation — Supported Glossary Language Pairs
## Not run: supported_glossary_language_pairs() ## End(Not run)## Not run: supported_glossary_language_pairs() ## End(Not run)
supported_glossary_language_pairs2 lists all language pairs supported for glossary creation
in the DeepL API Free.
supported_glossary_language_pairs2(auth_key)supported_glossary_language_pairs2(auth_key)
auth_key |
A string representing the authentication key for the DeepL API Free.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Free account at DeepL API Free.
DeepL API Documentation — Supported Glossary Language Pairs
## Not run: supported_glossary_language_pairs2() ## End(Not run)## Not run: supported_glossary_language_pairs2() ## End(Not run)
toChinese translates a text from any supported source language into Chinese using the DeepL API Pro.
Use available_languages to list all supported languages.
toChinese( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )toChinese( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
A character vector containing the text(s) to be translated. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language. If |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional string providing contextual information to improve translation quality, especially for short or ambiguous text. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls formality level of the translation (only for certain target languages):
|
glossary_id |
Optional. Glossary ID for custom translation. Must match the language pair and requires |
auth_key |
A string representing the authentication key for the DeepL API Pro.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Pro account at DeepL API Pro. This service may incur costs depending on the number of characters translated.
If get_detect = FALSE, a character vector with translations is returned.
If get_detect = TRUE, a tibble with the following columns is returned:
translation: The translated text.
source_lang: The detected or specified source language.
DeepL API Documentation — Translate
## Not run: toChinese("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toChinese(texts, get_detect = TRUE) ## End(Not run)## Not run: toChinese("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toChinese(texts, get_detect = TRUE) ## End(Not run)
toChinese2 translates a text from any supported source language into Chinese using the DeepL API Free.
Use available_languages2 to list all supported languages.
toChinese2( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )toChinese2( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
A character vector containing the text(s) to be translated. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language. If |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional string providing contextual information to improve translation quality, especially for short or ambiguous text. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls formality level of the translation (only for certain target languages):
|
glossary_id |
Optional. Glossary ID for custom translation. Must match the language pair and requires |
auth_key |
A string representing the authentication key for the DeepL API Free.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Free account at DeepL API Free. With the Free API, up to 500,000 characters per month can be translated at no cost.
If get_detect = FALSE, a character vector with translations is returned.
If get_detect = TRUE, a tibble with the following columns is returned:
translation: The translated text.
source_lang: The detected or specified source language.
DeepL API Documentation — Translate
## Not run: toChinese2("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toChinese2(texts, get_detect = TRUE) ## End(Not run)## Not run: toChinese2("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toChinese2(texts, get_detect = TRUE) ## End(Not run)
toEnglish translates a text from any supported source language into English using the DeepL API Pro.
Use available_languages to list all supported languages.
toEnglish( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )toEnglish( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
A character vector containing the text(s) to be translated. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language. If |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional string providing contextual information to improve translation quality, especially for short or ambiguous text. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls formality level of the translation (only for certain target languages):
|
glossary_id |
Optional. Glossary ID for custom translation. Must match the language pair and requires |
auth_key |
A string representing the authentication key for the DeepL API Pro.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Pro account at DeepL API Pro. This service may incur costs depending on the number of characters translated.
If get_detect = FALSE, a character vector with translations is returned.
If get_detect = TRUE, a tibble with the following columns is returned:
translation: The translated text.
source_lang: The detected or specified source language.
DeepL API Documentation — Translate
## Not run: toEnglish("Hallo Welt!") texts <- c("Me llamo Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toEnglish(texts, get_detect = TRUE) ## End(Not run)## Not run: toEnglish("Hallo Welt!") texts <- c("Me llamo Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toEnglish(texts, get_detect = TRUE) ## End(Not run)
toEnglish2 translates a text from any supported source language into English using the DeepL API Free.
Use available_languages2 to list all supported languages.
toEnglish2( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )toEnglish2( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
A character vector containing the text(s) to be translated. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language. If |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional string providing contextual information to improve translation quality, especially for short or ambiguous text. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls formality level of the translation (only for certain target languages):
|
glossary_id |
Optional. Glossary ID for custom translation. Must match the language pair and requires |
auth_key |
A string representing the authentication key for the DeepL API Free.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Free account at DeepL API Free. With the Free API, up to 500,000 characters per month can be translated at no cost.
If get_detect = FALSE, a character vector with translations is returned.
If get_detect = TRUE, a tibble with the following columns is returned:
translation: The translated text.
source_lang: The detected or specified source language.
DeepL API Documentation — Translate
## Not run: toEnglish2("Hallo Welt!") texts <- c("Me llamo Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toEnglish2(texts, get_detect = TRUE) ## End(Not run)## Not run: toEnglish2("Hallo Welt!") texts <- c("Me llamo Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toEnglish2(texts, get_detect = TRUE) ## End(Not run)
toFrench translates a text from any supported source language into French using the DeepL API Pro.
Use available_languages to list all supported languages.
toFrench( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )toFrench( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
A character vector containing the text(s) to be translated. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language. If |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional string providing contextual information to improve translation quality, especially for short or ambiguous text. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls formality level of the translation (only for certain target languages):
|
glossary_id |
Optional. Glossary ID for custom translation. Must match the language pair and requires |
auth_key |
A string representing the authentication key for the DeepL API Pro.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Pro account at DeepL API Pro. This service may incur costs depending on the number of characters translated.
If get_detect = FALSE, a character vector with translations is returned.
If get_detect = TRUE, a tibble with the following columns is returned:
translation: The translated text.
source_lang: The detected or specified source language.
DeepL API Documentation — Translate
## Not run: toFrench("Hallo Welt!") texts <- c("Me llamo Fred.", "I'm a doctor.", "Ich komme aus der Schweiz.") toFrench(texts, get_detect = TRUE) ## End(Not run)## Not run: toFrench("Hallo Welt!") texts <- c("Me llamo Fred.", "I'm a doctor.", "Ich komme aus der Schweiz.") toFrench(texts, get_detect = TRUE) ## End(Not run)
toFrench2 translates a text from any supported source language into French using the DeepL API Free.
Use available_languages2 to list all supported languages.
toFrench2( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )toFrench2( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
A character vector containing the text(s) to be translated. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language. If |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional string providing contextual information to improve translation quality, especially for short or ambiguous text. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls formality level of the translation (only for certain target languages):
|
glossary_id |
Optional. Glossary ID for custom translation. Must match the language pair and requires |
auth_key |
A string representing the authentication key for the DeepL API Free.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Free account at DeepL API Free. With the Free API, up to 500,000 characters per month can be translated at no cost.
If get_detect = FALSE, a character vector with translations is returned.
If get_detect = TRUE, a tibble with the following columns is returned:
translation: The translated text.
source_lang: The detected or specified source language.
DeepL API Documentation — Translate
## Not run: toFrench2("Hallo Welt!") texts <- c("Me llamo Fred.", "I'm a doctor.", "Ich komme aus der Schweiz.") toFrench2(texts, get_detect = TRUE) ## End(Not run)## Not run: toFrench2("Hallo Welt!") texts <- c("Me llamo Fred.", "I'm a doctor.", "Ich komme aus der Schweiz.") toFrench2(texts, get_detect = TRUE) ## End(Not run)
toGerman translates a text from any supported source language into German using the DeepL API Pro.
Use available_languages to list all supported languages.
toGerman( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )toGerman( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
A character vector containing the text(s) to be translated. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language. If |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional string providing contextual information to improve translation quality, especially for short or ambiguous text. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls formality level of the translation (only for certain target languages):
|
glossary_id |
Optional. Glossary ID for custom translation. Must match the language pair and requires |
auth_key |
A string representing the authentication key for the DeepL API Pro.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Pro account at DeepL API Pro. This service may incur costs depending on the number of characters translated.
If get_detect = FALSE, a character vector with translations is returned.
If get_detect = TRUE, a tibble with the following columns is returned:
translation: The translated text.
source_lang: The detected or specified source language.
DeepL API Documentation — Translate
## Not run: toGerman("Hello world!") texts <- c("Me llamo Fred.", "Je suis médecin.", "I'm from Brisbane.") toGerman(texts, get_detect = TRUE) ## End(Not run)## Not run: toGerman("Hello world!") texts <- c("Me llamo Fred.", "Je suis médecin.", "I'm from Brisbane.") toGerman(texts, get_detect = TRUE) ## End(Not run)
toGerman2 translates a text from any supported source language into German using the DeepL API Free.
Use available_languages2 to list all supported languages.
toGerman2( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )toGerman2( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
A character vector containing the text(s) to be translated. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language. If |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional string providing contextual information to improve translation quality, especially for short or ambiguous text. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls formality level of the translation (only for certain target languages):
|
glossary_id |
Optional. Glossary ID for custom translation. Must match the language pair and requires |
auth_key |
A string representing the authentication key for the DeepL API Free.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Free account at DeepL API Free. With the Free API, up to 500,000 characters per month can be translated at no cost.
If get_detect = FALSE, a character vector with translations is returned.
If get_detect = TRUE, a tibble with the following columns is returned:
translation: The translated text.
source_lang: The detected or specified source language.
DeepL API Documentation — Translate
## Not run: toGerman2("Hello world!") texts <- c("Me llamo Fred.", "Je suis médecin.", "I'm from Brisbane.") toGerman2(texts, get_detect = TRUE) ## End(Not run)## Not run: toGerman2("Hello world!") texts <- c("Me llamo Fred.", "Je suis médecin.", "I'm from Brisbane.") toGerman2(texts, get_detect = TRUE) ## End(Not run)
toItalian translates a text from any supported source language into Italian using the DeepL API Pro.
Use available_languages to list all supported languages.
toItalian( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )toItalian( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
A character vector containing the text(s) to be translated. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language. If |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional string providing contextual information to improve translation quality, especially for short or ambiguous text. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls formality level of the translation (only for certain target languages):
|
glossary_id |
Optional. Glossary ID for custom translation. Must match the language pair and requires |
auth_key |
A string representing the authentication key for the DeepL API Pro.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Pro account at DeepL API Pro. This service may incur costs depending on the number of characters translated.
If get_detect = FALSE, a character vector with translations is returned.
If get_detect = TRUE, a tibble with the following columns is returned:
translation: The translated text.
source_lang: The detected or specified source language.
DeepL API Documentation — Translate
## Not run: toItalian("Hallo Welt!") texts <- c("Me llamo Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toItalian(texts, get_detect = TRUE) ## End(Not run)## Not run: toItalian("Hallo Welt!") texts <- c("Me llamo Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toItalian(texts, get_detect = TRUE) ## End(Not run)
toItalian2 translates a text from any supported source language into Italian using the DeepL API Free.
Use available_languages2 to list all supported languages.
toItalian2( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )toItalian2( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
A character vector containing the text(s) to be translated. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language. If |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional string providing contextual information to improve translation quality, especially for short or ambiguous text. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls formality level of the translation (only for certain target languages):
|
glossary_id |
Optional. Glossary ID for custom translation. Must match the language pair and requires |
auth_key |
A string representing the authentication key for the DeepL API Free.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Free account at DeepL API Free. With the Free API, up to 500,000 characters per month can be translated at no cost.
If get_detect = FALSE, a character vector with translations is returned.
If get_detect = TRUE, a tibble with the following columns is returned:
translation: The translated text.
source_lang: The detected or specified source language.
DeepL API Documentation — Translate
## Not run: toItalian2("Hallo Welt!") texts <- c("Me llamo Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toItalian2(texts, get_detect = TRUE) ## End(Not run)## Not run: toItalian2("Hallo Welt!") texts <- c("Me llamo Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toItalian2(texts, get_detect = TRUE) ## End(Not run)
toJapanese translates a text from any supported source language into Japanese using the DeepL API Pro.
Use available_languages to list all supported languages.
toJapanese( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )toJapanese( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
A character vector containing the text(s) to be translated. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language. If |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional string providing contextual information to improve translation quality, especially for short or ambiguous text. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls formality level of the translation (only for certain target languages):
|
glossary_id |
Optional. Glossary ID for custom translation. Must match the language pair and requires |
auth_key |
A string representing the authentication key for the DeepL API Pro.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Pro account at DeepL API Pro. This service may incur costs depending on the number of characters translated.
If get_detect = FALSE, a character vector with translations is returned.
If get_detect = TRUE, a tibble with the following columns is returned:
translation: The translated text.
source_lang: The detected or specified source language.
DeepL API Documentation — Translate
## Not run: toJapanese("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toJapanese(texts, get_detect = TRUE) ## End(Not run)## Not run: toJapanese("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toJapanese(texts, get_detect = TRUE) ## End(Not run)
toJapanese2 translates a text from any supported source language into Japanese using the DeepL API Free.
Use available_languages2 to list all supported languages.
toJapanese2( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )toJapanese2( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
A character vector containing the text(s) to be translated. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language. If |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional string providing contextual information to improve translation quality, especially for short or ambiguous text. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls formality level of the translation (only for certain target languages):
|
glossary_id |
Optional. Glossary ID for custom translation. Must match the language pair and requires |
auth_key |
A string representing the authentication key for the DeepL API Free.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Free account at DeepL API Free. With the Free API, up to 500,000 characters per month can be translated at no cost.
If get_detect = FALSE, a character vector with translations is returned.
If get_detect = TRUE, a tibble with the following columns is returned:
translation: The translated text.
source_lang: The detected or specified source language.
DeepL API Documentation — Translate
## Not run: toJapanese2("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toJapanese2(texts, get_detect = TRUE) ## End(Not run)## Not run: toJapanese2("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toJapanese2(texts, get_detect = TRUE) ## End(Not run)
toPortuguese translates a text from any supported source language into Portuguese using the DeepL API Pro.
Use available_languages to list all supported languages.
toPortuguese( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )toPortuguese( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
A character vector containing the text(s) to be translated. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language. If |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional string providing contextual information to improve translation quality, especially for short or ambiguous text. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls formality level of the translation (only for certain target languages):
|
glossary_id |
Optional. Glossary ID for custom translation. Must match the language pair and requires |
auth_key |
A string representing the authentication key for the DeepL API Pro.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Pro account at DeepL API Pro. This service may incur costs depending on the number of characters translated.
If get_detect = FALSE, a character vector with translations is returned.
If get_detect = TRUE, a tibble with the following columns is returned:
translation: The translated text.
source_lang: The detected or specified source language.
DeepL API Documentation — Translate
## Not run: toPortuguese("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toPortuguese(texts, get_detect = TRUE) ## End(Not run)## Not run: toPortuguese("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toPortuguese(texts, get_detect = TRUE) ## End(Not run)
toPortuguese2 translates a text from any supported source language into Portuguese using the DeepL API Free.
Use available_languages2 to list all supported languages.
toPortuguese2( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )toPortuguese2( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
A character vector containing the text(s) to be translated. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language. If |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional string providing contextual information to improve translation quality, especially for short or ambiguous text. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls formality level of the translation (only for certain target languages):
|
glossary_id |
Optional. Glossary ID for custom translation. Must match the language pair and requires |
auth_key |
A string representing the authentication key for the DeepL API Free.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Free account at DeepL API Free. With the Free API, up to 500,000 characters per month can be translated at no cost.
If get_detect = FALSE, a character vector with translations is returned.
If get_detect = TRUE, a tibble with the following columns is returned:
translation: The translated text.
source_lang: The detected or specified source language.
DeepL API Documentation — Translate
## Not run: toPortuguese2("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toPortuguese2(texts, get_detect = TRUE) ## End(Not run)## Not run: toPortuguese2("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toPortuguese2(texts, get_detect = TRUE) ## End(Not run)
toRussian translates a text from any supported source language into Russian using the DeepL API Pro.
Use available_languages to list all supported languages.
toRussian( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )toRussian( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
A character vector containing the text(s) to be translated. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language. If |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional string providing contextual information to improve translation quality, especially for short or ambiguous text. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls formality level of the translation (only for certain target languages):
|
glossary_id |
Optional. Glossary ID for custom translation. Must match the language pair and requires |
auth_key |
A string representing the authentication key for the DeepL API Pro.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Pro account at DeepL API Pro. This service may incur costs depending on the number of characters translated.
If get_detect = FALSE, a character vector with translations is returned.
If get_detect = TRUE, a tibble with the following columns is returned:
translation: The translated text.
source_lang: The detected or specified source language.
DeepL API Documentation — Translate
## Not run: toRussian("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toRussian(texts, get_detect = TRUE) ## End(Not run)## Not run: toRussian("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toRussian(texts, get_detect = TRUE) ## End(Not run)
toRussian2 translates a text from any supported source language into Russian using the DeepL API Free.
Use available_languages2 to list all supported languages.
toRussian2( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )toRussian2( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
A character vector containing the text(s) to be translated. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language. If |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional string providing contextual information to improve translation quality, especially for short or ambiguous text. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls formality level of the translation (only for certain target languages):
|
glossary_id |
Optional. Glossary ID for custom translation. Must match the language pair and requires |
auth_key |
A string representing the authentication key for the DeepL API Free.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Free account at DeepL API Free. With the Free API, up to 500,000 characters per month can be translated at no cost.
If get_detect = FALSE, a character vector with translations is returned.
If get_detect = TRUE, a tibble with the following columns is returned:
translation: The translated text.
source_lang: The detected or specified source language.
DeepL API Documentation — Translate
## Not run: toRussian2("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toRussian2(texts, get_detect = TRUE) ## End(Not run)## Not run: toRussian2("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toRussian2(texts, get_detect = TRUE) ## End(Not run)
toSpanish translates a text from any supported source language into Spanish using the DeepL API Pro.
Use available_languages to list all supported languages.
toSpanish( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )toSpanish( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
A character vector containing the text(s) to be translated. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language. If |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional string providing contextual information to improve translation quality, especially for short or ambiguous text. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls formality level of the translation (only for certain target languages):
|
glossary_id |
Optional. Glossary ID for custom translation. Must match the language pair and requires |
auth_key |
A string representing the authentication key for the DeepL API Pro.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Pro account at DeepL API Pro. This service may incur costs depending on the number of characters translated.
If get_detect = FALSE, a character vector with translations is returned.
If get_detect = TRUE, a tibble with the following columns is returned:
translation: The translated text.
source_lang: The detected or specified source language.
DeepL API Documentation — Translate
## Not run: toSpanish("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toSpanish(texts, get_detect = TRUE) ## End(Not run)## Not run: toSpanish("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toSpanish(texts, get_detect = TRUE) ## End(Not run)
toSpanish2 translates a text from any supported source language into Spanish using the DeepL API Free.
Use available_languages2 to list all supported languages.
toSpanish2( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )toSpanish2( text, source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
A character vector containing the text(s) to be translated. Only UTF-8 encoded plain text is supported. Each element may contain multiple sentences but should not exceed 30 kB. |
source_lang |
A string specifying the source language. If |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional string providing contextual information to improve translation quality, especially for short or ambiguous text. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls formality level of the translation (only for certain target languages):
|
glossary_id |
Optional. Glossary ID for custom translation. Must match the language pair and requires |
auth_key |
A string representing the authentication key for the DeepL API Free.
If not provided, the function will attempt to retrieve the key from the environment
variable |
To use this function, you must obtain an authentication key by registering for a DeepL API Free account at DeepL API Free. With the Free API, up to 500,000 characters per month can be translated at no cost.
If get_detect = FALSE, a character vector with translations is returned.
If get_detect = TRUE, a tibble with the following columns is returned:
translation: The translated text.
source_lang: The detected or specified source language.
DeepL API Documentation — Translate
## Not run: toSpanish2("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toSpanish2(texts, get_detect = TRUE) ## End(Not run)## Not run: toSpanish2("Hallo Welt!") texts <- c("My name is Fred.", "Je suis médecin.", "Ich komme aus der Schweiz.") toSpanish2(texts, get_detect = TRUE) ## End(Not run)
Translates UTF-8 encoded plain text between supported languages using the DeepL API Pro. A list of supported source and target languages is available at https://developers.deepl.com/docs/getting-started/supported-languages. An authentication key is required to use this service. Charges may apply based on the number of characters translated.
translate( text, target_lang = "EN", source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )translate( text, target_lang = "EN", source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
Character vector. The text(s) to translate. Each element can contain multiple sentences but must not exceed 30 kB. Only UTF-8 plain text is supported. |
target_lang |
Character vector. Target language(s) for translation. If length 1, all texts are translated into the same language. |
source_lang |
Character vector or |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional. Contextual text to improve translation quality, especially for short or ambiguous inputs. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls the formality level of the translation (only supported for certain target languages):
|
glossary_id |
Optional. Glossary ID for translation. Must match the language pair and requires |
auth_key |
Character. Your DeepL API authentication key. If missing, the function uses
the |
Register for a DeepL API Pro key at https://www.deepl.com/pro#developer.
Only texts passed via the text argument count toward your monthly quota.
If get_detect = FALSE, returns a character vector of translated texts.
If get_detect = TRUE, returns a tibble with:
translation – Translated text.
source_lang – Detected or provided source language.
DeepL API Documentation — Translate
## Not run: translate("I like to translate texts.", target_lang = "DE") translate( c("I like to translate texts.", "Ich übersetze gerne Texte."), target_lang = "FR" ) translate("I like to translate texts.", target_lang = c("FR", "DE", "IT")) translate( c("I like to translate texts.", "Ich übersetze gerne Texte."), target_lang = c("FR", "IT") ) ## End(Not run)## Not run: translate("I like to translate texts.", target_lang = "DE") translate( c("I like to translate texts.", "Ich übersetze gerne Texte."), target_lang = "FR" ) translate("I like to translate texts.", target_lang = c("FR", "DE", "IT")) translate( c("I like to translate texts.", "Ich übersetze gerne Texte."), target_lang = c("FR", "IT") ) ## End(Not run)
Translates UTF-8 encoded plain text between supported languages using the DeepL API Free. A list of supported source and target languages is available at https://developers.deepl.com/docs/getting-started/supported-languages. An authentication key is required. The Free plan allows up to 500,000 characters per month.
translate2( text, target_lang = "EN", source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )translate2( text, target_lang = "EN", source_lang = NULL, split_sentences = TRUE, preserve_formatting = FALSE, get_detect = FALSE, context = NULL, model_type = NULL, formality = NULL, glossary_id = NULL, auth_key )
text |
Character vector. The text(s) to translate. Each element can contain multiple sentences but must not exceed 30 kB. Only UTF-8 plain text is supported. |
target_lang |
Character vector. Target language(s) for translation. If length 1, all texts are translated into the same language. |
source_lang |
Character vector or |
split_sentences |
Logical. If |
preserve_formatting |
Logical. If |
get_detect |
Logical. If |
context |
Optional. Contextual text to improve translation quality, especially for short or ambiguous inputs. Context is not translated and does not count toward character limits. |
model_type |
Optional. Specifies the DeepL model to use:
|
formality |
Optional. Controls the formality level of the translation (only supported for certain target languages):
|
glossary_id |
Optional. Glossary ID for translation. Must match the language pair and requires |
auth_key |
Character. Your DeepL API authentication key. If missing, the function uses
the |
Register for a free DeepL API key at https://www.deepl.com/pro#developer.
Only texts passed via the text argument count toward your monthly character quota.
If get_detect = FALSE, returns a character vector of translated texts.
If get_detect = TRUE, returns a tibble with:
translation – Translated text.
source_lang – Detected or provided source language.
DeepL API Documentation — Translate
## Not run: translate2("I like to translate texts.", target_lang = "DE") translate2( c("I like to translate texts.", "Ich übersetze gerne Texte."), target_lang = "FR" ) translate2("I like to translate texts.", target_lang = c("FR", "DE", "IT")) translate2( c("I like to translate texts.", "Ich übersetze gerne Texte."), target_lang = c("FR", "IT") ) ## End(Not run)## Not run: translate2("I like to translate texts.", target_lang = "DE") translate2( c("I like to translate texts.", "Ich übersetze gerne Texte."), target_lang = "FR" ) translate2("I like to translate texts.", target_lang = c("FR", "DE", "IT")) translate2( c("I like to translate texts.", "Ich übersetze gerne Texte."), target_lang = c("FR", "IT") ) ## End(Not run)
usage returns the character usage and configured character limit for the current billing period
of a DeepL API Pro account.
usage(auth_key)usage(auth_key)
auth_key |
Character. Your DeepL API authentication key. If missing, the function uses
the |
To use this function, you must register for a DeepL API Pro account at https://www.deepl.com/pro#developer.
A named list or structured object containing:
character_count – Number of characters used in the current billing period.
character_limit – Total character limit for the current billing period.
DeepL API Documentation — Usage
## Not run: usage() ## End(Not run)## Not run: usage() ## End(Not run)
usage2 returns the character usage and configured character limit for the current billing period
of a DeepL API Free account.
usage2(auth_key)usage2(auth_key)
auth_key |
Character. Your DeepL API authentication key. If missing, the function uses
the |
To use this function, you must register for a DeepL API Free account at https://www.deepl.com/pro#developer. The Free plan includes up to 500,000 characters per month.
A named list or structured object containing:
character_count – Number of characters used in the current billing period.
character_limit – Total character limit for the current billing period.
DeepL API Documentation — Usage
## Not run: usage2() ## End(Not run)## Not run: usage2() ## End(Not run)