Multilingual Language Translator using Python
Translating the text from one language to another- "One of the ways to learn another Language"
“Python language translator”
“Real-time translation with Python”
"language detection and translation script”
Python Code:
from tkinter import *
import translators as ts
Screen = Tk()
Screen.geometry("700x300")
Screen.title("Language Translator with GUI")
Screen.config(background="pink")
InputLanguageChoice = StringVar()
TranslateLanguageChoice = StringVar()
LanguageChoices = {'hi/Hindi','en/English','ur/Urdu','id/Indonesian','fr/French','de/German','es/Spanish'}
InputLanguageChoice.set('en/English')
TranslateLanguageChoice.set('hi/Hindi')
def Translate():
translat = ts.google(TextVar.get(),from_language=InputLanguageChoice.get()[:2],to_language=TranslateLanguageChoice.get()[:2])
OutputVar.set(translat)
choice for input language
InputLanguageChoiceMenu = OptionMenu(Screen, InputLanguageChoice, *LanguageChoices)
Label(Screen, text="Choose a Language",font="Arial 12",bg="white",fg="red").grid(row=0, column=1,pady=15)
InputLanguageChoiceMenu.grid(row=1, column=1,padx=10,pady=10)
choice in which the language is to be translated
NewLanguageChoiceMenu = OptionMenu(Screen, TranslateLanguageChoice, *LanguageChoices)
Label(Screen, text="Translated Language",font="Arial 12",bg="white",fg="red").grid(row=0, column=2)
NewLanguageChoiceMenu.grid(row=1, column=2,padx=10,pady=10)
Label(Screen, text="Enter Text",font="Arial 14",bg="white",fg="red").grid(row=2, column=0)
TextVar = StringVar()
TextBox = Entry(Screen, textvariable=TextVar,width=30,font="Arial 10").grid(row=2, column=1)
Label(Screen, text="Output Text",font="Arial 14",bg="white",fg="red").grid(row=2, column=2)
OutputVar = StringVar()
TextBox = Entry(Screen, textvariable=OutputVar,width=30,font="Arial 10").grid(row=2, column=3)
Button for calling function
B = Button(Screen, text="Translate", command=Translate,font="Arial 14",bg="Bisque").grid(row=7, column=1, columnspan=3,padx=10,pady=10)
mainloop()
#python #programming #graphical #userinterface #tkinter #module #language #translation #learning #interesting #multilingual
#like #share #subscribe
In questa pagina del sito puoi guardare il video online Multilingual Language Translator using Python della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Mastering Technology 30 luglio 2025, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 98 volte e gli è piaciuto 4 spettatori. Buona visione!