#R : Language detection and translation



Hey Everyone,

I have a dataset which has text in various different languages. Are there any package in R to perform below functions:

  1. Detect the language of the text: I tried textcat but not very helpful.
  2. Convert the text into English language: Tried to use the Yandex translate API. But receiving error "Could not resolve host: translate.yandex.net "

Thanks in advance…!!

  1. Maybe "langid" library would help.
  2. Have you enabled the API key for yandex translate? I suggest you to follow the instructions carefully


Thank you. I am receiving the below error when i run the yandex API.

lan <- detect_language(api_key, text = “How are you?”)
Error in function (type, msg, asError = TRUE) :
SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054


Maybe you should ask this query to their support https://yandex.com/support/



If this question is still open…in R there is a package for this:


franc: Detect the Language of Text

With no external dependencies and support for 335 languages; all languages spoken by more than one million speakers. ‘Franc’ is a port of the ‘JavaScript’ project of the same name, see https://github.com/wooorm/franc.