If you're looking to actually translate a string of text between two languages, say from English "Hello" to Spanish "Hola", you might want to look into the Google Language API.
Another alternative due to recent deprecation of the free version of Google's API is the Bing Translator API.
Lastly, Google Cloud Platform offers the Translate API as a service, costing about $1 USD per 50,000 characters translated.