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.
- 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
.mp3audio 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.
Ensure your local development space or container environment satisfies the core operational requirements.
Execute the standard pip command to install the third-party structural libraries needed for the runtime:
pip install deep_translator gttsThe execution cycle follows strict modular program architectures to split concerns clean:
display_menu(): Renders a clean 80-character standard terminal grid containing indexed ISO language codes.get_language_choice(): Implements a strict runtime input validation lookahead to reject invalid integer selections.main()Function Loop: Orchestrates data capture, verifies cross-lingual variance logic, fires API routines, and triggers supplementary handlers.handle_optional_features(): Spawns concurrent sub-tasks handling secondary storage requests (audio serialization / formatted text dumping).
=================================================================
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'!
├── 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)
- Organization: CodeAlpha
- Domain: Artificial Intelligence / Software Engineering
- Assignment: Task 1 - Development of an Advanced Translation Program with Multi-Feature Integration