Multilingual Language Translator using Python

Published: 30 July 2025
on channel: Mastering Technology
98
4

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


On this page of the site you can watch the video online Multilingual Language Translator using Python with a duration of hours minute second in good quality, which was uploaded by the user Mastering Technology 30 July 2025, share the link with friends and acquaintances, this video has already been watched 98 times on youtube and it was liked by 4 viewers. Enjoy your viewing!