UpdateGadh

UPDATEGADH.COM

language translator using python project using google Api

Introduction:

Have you ever wondered how people from different parts of the world communicate seamlessly, even with language barriers? Thanks to advancements in technology, we now have language translator tools that enable us to bridge the gap and foster global connections. In this article, we will explore the fascinating world of language translation and how to create a language translator using Python. So let’s dive in and embark on this exciting journey!

WhatsApp Group Join Now
Youtube Click here
Instagram Click here
Telegram Group Join Now
Java Project – Updategadh
updategadh.com

Project Name               :  language translator using python

Language Used                   :  Python

User Interface Design       :  HTML,CSS,JAVASCRIPT ,JQUERY

Web Browser                       :  Google Chrome, IE8,

Software /IDE                        :  PyCharm

  • PyCharm.
  • Python

Downloading and Setting Up a Project in PyCharm:

  1. Download the Zip File:
    • Visit the download link provided.
    • Click on the “Download” button to download the zip file.
  2. Extract the File, Copy Folder, and Paste on the Desktop:
    • Locate the downloaded zip file on your computer.
    • Right-click on the file and choose “Extract” or “Extract Here” to extract its contents.
    • You should now see a folder named after extraction.
    • Copy the folder.
    • Navigate to your desktop.
    • Right-click on the desktop and choose “Paste” to copy the folder onto your desktop.
  3. Open PyCharm:
    • Locate the PyCharm IDE on your computer and open it.
    • If you don’t have PyCharm installed, you can download it from the official JetBrains website and follow the installation instructions.
  4. Open Project in PyCharm:
    • Once PyCharm is open, click on “File” in the top menu.
    • Select “Open” or “Open Project” depending on your PyCharm version.
    • Navigate to your desktop and select the folder.
    • Click “Open” to open the project in PyCharm.
  5. Project Will Open in PyCharm:
    • After opening the project in PyCharm, you will see the project structure and files in the PyCharm IDE.
  6. pip install -r requirements.txt
  7. After satisfying all the requirements for the project, Open the terminal in the project folder and run
python translator.py

For Update

pip install --upgrade googletrans==4.0.0-rc1 httpcore

Virus note: All files are scanned once-a-day by updategadh.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe’s, .ocx’s, .dll’s etc.)–only run source code.
Note: Only for Educational Purpose

Download Free Project :- Click here

from tkinter import *
import tkinter as tk
from tkinter import ttk
from googletrans import Translator
from tkinter import messagebox

# Creating Tkinter Scaffold
root = tk.Tk()
root.title('Langauge Translator')
root.geometry('530x330')
root.maxsize(530, 330)
root.minsize(530, 330)

# Function to translate using the translator package


def translate():
    language_1 = t1.get("1.0", "end-1c")
    cl = choose_langauge.get()

    if language_1 == '':
        messagebox.showerror('Language Translator', 'please fill the box')
    else:
        t2.delete(1.0, 'end')
        translator = Translator()
        output = translator.translate(language_1, dest=cl)
        t2.insert('end', output.text)


# Function to clear the input fields
def clear():
    t1.delete(1.0, 'end')
    t2.delete(1.0, 'end')


# SelectBox 1 for auto detected language
auto_detect_language = tk.StringVar()
auto_detect = ttk.Combobox(
    root,
    width=20,
    textvariable=auto_detect_language,
    state='readonly',
    font=('verdana', 10, 'bold'),
)

auto_detect['values'] = ('Auto Detect', )

auto_detect.place(x=30, y=70)
auto_detect.current(0)

# SelectBox 2 for selected language
language_selected = tk.StringVar()
choose_langauge = ttk.Combobox(root,
                               width=20,
                               textvariable=language_selected,
                               state='readonly',
                               font=('verdana', 10, 'bold'))

# List of available language options for translation
choose_langauge['values'] = (
    'Afrikaans',
    'Albanian',
    'Arabic',
    'Armenian',
    ' Azerbaijani',
    'Basque',
    'Belarusian',
    'Bengali',
    'Bosnian',
    'Bulgarian',
    ' Catalan',
    'Cebuano',
    'Chichewa',
    'Chinese',
    'Corsican',
    'Croatian',
    ' Czech',
    'Danish',
    'Dutch',
    'English',
    'Esperanto',
    'Estonian',
    'Filipino',
    'Finnish',
    'French',
    'Frisian',
    'Galician',
    'Georgian',
    'German',
    'Greek',
    'Gujarati',
    'Haitian Creole',
    'Hausa',
    'Hawaiian',
    'Hebrew',
    'Hindi',
    'Hmong',
    'Hungarian',
    'Icelandic',
    'Igbo',
    'Indonesian',
    'Irish',
    'Italian',
    'Japanese',
    'Javanese',
    'Kannada',
    'Kazakh',
    'Khmer',
    'Kinyarwanda',
    'Korean',
    'Kurdish',
    'Kyrgyz',
    'Lao',
    'Latin',
    'Latvian',
    'Lithuanian',
    'Luxembourgish',
    'Macedonian',
    'Malagasy',
    'Malay',
    'Malayalam',
    'Maltese',
    'Maori',
    'Marathi',
    'Mongolian',
    'Myanmar',
    'Nepali',
    'Norwegian'
    'Odia',
    'Pashto',
    'Persian',
    'Polish',
    'Portuguese',
    'Punjabi',
    'Romanian',
    'Russian',
    'Samoan',
    'Scots Gaelic',
    'Serbian',
    'Sesotho',
    'Shona',
    'Sindhi',
    'Sinhala',
    'Slovak',
    'Slovenian',
    'Somali',
    'Spanish',
    'Sundanese',
    'Swahili',
    'Swedish',
    'Tajik',
    'Tamil',
    'Tatar',
    'Telugu',
    'Thai',
    'Turkish',
    'Turkmen',
    'Ukrainian',
    'Urdu',
    'Uyghur',
    'Uzbek',
    'Vietnamese',
    'Welsh',
    'Xhosa'
    'Yiddish',
    'Yoruba',
    'Zulu',
)

choose_langauge.place(x=290, y=70)
choose_langauge.current(0)

# To store Input Text
t1 = Text(root, width=30, height=10, borderwidth=5, relief=RIDGE)
t1.place(x=10, y=100)

# To store translated Text
t2 = Text(root, width=30, height=10, borderwidth=5, relief=RIDGE)
t2.place(x=260, y=100)

button = Button(root,
                text="Translate",
                relief=RIDGE,
                borderwidth=3,
                font=('verdana', 10, 'bold'),
                cursor="hand2",
                foreground='Green',
                command=translate)
button.place(x=150, y=280)

clear = Button(root,
               text="Clear",
               relief=RIDGE,
               borderwidth=3,
               font=('verdana', 10, 'bold'),
               cursor="hand2",
               foreground='Red',
               command=clear)
clear.place(x=280, y=280)

root.mainloop()

requirements.txt

googletrans==3.1.0a0
httpx>=0.23.0 

Download Other Free Project :- Click here

E-Commerce Website Project in Java
E-Commerce Website Project in Java
WhatsApp Group Join Now
Youtube Click here
Instagram Click here
Telegram Group Join Now

Looking to build a language translator using Python? This article explores the process of creating a language translator project using Python, breaking down language barriers effortlessly. Discover the world of language translation now!

Leave a Reply

Your email address will not be published. Required fields are marked *