repl.it
@spybrave/

Language-Translator

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from translate import Translator
import replit
languages = {
	1:'zh',
	2:'cs',
	3:'da',
	4:'nl',
	5:'fr',
	6:'de',
	7:'el',
	8:'it',
	9:'ja',
	10:'ko',
	11:'pt',
	12:'ru',
	13:'es',
	14:'ur',
	15:'ta'
}
replit.clear()
lang=int(input(' 1.Chinese\n 2.Czech\n 3.Danish\n 4.Dutch\n 5.French\n 6.German\n 7.Greek\n 8.Italian\n 9.Japanese\n10.Korean\n11.Portuguese\n12.Russian\n13.Spanish\n14.Urdu\n\nPick the corresponding number : '))
lang=languages[lang]
replit.clear()
phrase= input('English Phrase/Sentence : ')
translator= Translator(to_lang=lang)
translation = translator.translate(phrase)
replit.clear()
print('\n\n'+str(translation)+'\n\n')