Translate

From RHS Wiki
Revision as of 11:07, 20 May 2019 by Rafahsolis (talk | contribs) (→‎Langdetect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
pip install googletrans
from googletrans import Translator
translator = Translator()
translator.translate('안녕하세요.').text
translator.translate('안녕하세요.', dest='ja')

Language detection[edit]

googletrans[edit]

from googletrans import Translator
translator.detect('veritas lux mea').lang

Langdetect[edit]

pip install langdetect
from langdetect import detect
detect("War doesn't show who's right, just who's left.")
detect("Ein, zwei, drei, vier")