Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

CodeAlpha AI Internship - Advanced Language Translator Tool

An asynchronous, terminal-based advanced language translation utility engineered as part of the CodeAlpha AI Internship (Task 1). This tool leverages the Google Translate API wrapper via deep_translator to provide seamless cross-lingual data payload processing, coupled with auxiliary features like automated Text-to-Speech (TTS) stream generation and structured clipboard allocation blocks.


🚀 Key Deliverables & Features

  • Robust Language Mapping Architecture: Implements a validated user interface menu driven by structured python dictionaries to secure zero-fault translation configs.
  • Dynamic API Translation Pipeline: Executes real-time asynchronous request processing to fetch precise linguistic conversions.
  • Integrated Text-to-Speech (TTS): Automatically compiles translated output into standard .mp3 audio files via the Google Text-to-Speech (gTTS) API library engine.
  • Collision & Exception Handling: Includes algorithmic checks to prevent runtime failures, identical source/target loops, and empty data payload submissions.
  • Dedicated Clipboard Export Design: Features an isolated string formatting wrapper layout allowing smooth manual target selection.

🛠️ System Environment Setup

Ensure your local development space or container environment satisfies the core operational requirements.

Dependencies Installation

Execute the standard pip command to install the third-party structural libraries needed for the runtime:

pip install deep_translator gtts

⚙️ Architecture & Logic Flow

The execution cycle follows strict modular program architectures to split concerns clean:

  1. display_menu(): Renders a clean 80-character standard terminal grid containing indexed ISO language codes.
  2. get_language_choice(): Implements a strict runtime input validation lookahead to reject invalid integer selections.
  3. main() Function Loop: Orchestrates data capture, verifies cross-lingual variance logic, fires API routines, and triggers supplementary handlers.
  4. handle_optional_features(): Spawns concurrent sub-tasks handling secondary storage requests (audio serialization / formatted text dumping).

📊 Sample Execution Log

=================================================================
      CODEALPHA AI INTERNSHIP | TASK 1: LANGUAGE TRANSLATOR
=================================================================
 [Features Included: API Translation, Text-to-Speech, Copy Output]
-----------------------------------------------------------------
  1. English      2. Hindi        3. French      
  4. Spanish      5. German       6. Italian     
  7. Japanese     8. Chinese      9. Russian     
  10. Arabic      
=================================================================

Select Source Language (Number): 1
Select Target Language (Number): 2

Enter text in [English] to translate: hello how are you

[*] Initializing asynchronous request to Google Translate API wrapper...

══════════════════════════════════════════════════
 ORIGINAL [ENGLISH]: hello how are you
--------------------------------------------------
 TRANSLATED [HINDI]: नमस्ते, आप कैसे हैं
══════════════════════════════════════════════════

----------------------------------------
 Optional Features Available:
 1. Listen to translated audio (Text-to-Speech)
 2. Generate copyable text block
 3. Skip / Translate new text
----------------------------------------
Select an option (1/2/3): 1
[*] Generating audio stream via gTTS API... Please wait...
[✓] Audio file successfully compiled as 'translated_audio.mp3'!

📂 Repository Workspace Mapping

├── main.py                 # Core executable containing translation runtime logic
├── README.md               # Detailed architectural and setup documentation
└── translated_audio.mp3    # Compiled binary speech streams (generated during runtime)

🎓 Internship Framework

  • Organization: CodeAlpha
  • Domain: Artificial Intelligence / Software Engineering
  • Assignment: Task 1 - Development of an Advanced Translation Program with Multi-Feature Integration

About

A simple Python language translation tool using the deep-translator library. It translates text between multiple languages quickly and accurately.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages