Description Usage Arguments Value Author(s) References See Also Examples
Function uses MyMemory Translation API to find first available machine translation of given phrase. If machine translation is not available function returns first human translation with maximum quality score.
1 | translate(txt, from = langFROM, to = langTO)
|
txt |
Text to translate |
from |
ISO2 code of origin language, e.g. "en" or "de" |
to |
ISO2 code of target language |
Function returns single string with translation.
Alexander Gedranovich <gedranovich@gmail.com>
http://mymemory.translated.net/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Default translation from English to Russian
translate("Hello")
# Translation from English to German
translate("Hello", to="de")
# Translation from German to Spanish
translate("Hallo", from="de", to="es")
# Sentence translation
translate("To be or not to be?")
# Batch translation
txt <- c("Hello", "world", "To be or not to be?")
sapply(txt, translate, to="es")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.