This function applies the translate_text function to each element of a character vector, allowing for batch translation of multiple text strings. It preserves the original text if translation fails or returns NA.
Value
A character vector of the same length as the input, containing translated strings or the original strings if translation failed
See also
translate_text for translating individual strings
Examples
if (FALSE) { # \dontrun{
# Translate multiple strings from English to French
translate_text_vec(
c("Hello world", "Good morning", "Thank you"),
target_language = "fr"
)
# Translate with custom cache location
translate_text_vec(
c("Data analysis", "Statistical model"),
target_language = "es",
cache_path = "~/translation_cache"
)
} # }
