Translator-GO-Endpoint/scripts/python/translate.py

9 lines
222 B
Python

import argostranslate.package
import argostranslate.translate
def translate(message, from_lang, to_lang):
translation = argostranslate.translate.translate(message, from_lang, to_lang)
return translation