This is a simple asynchronous text translation software using Google Translate in Python. It allows users to input and translate text between different languages using the googletrans library.
- Asynchronous translation using
asyncio - Supports multiple languages
- User-friendly command-line interface
- Error handling for invalid inputs
Ensure you have Python installed (Python 3.7+ is recommended). You also need to install the required dependencies.
-
Clone this repository:
git clone https://github.com/ucheblessed28/python-translator.git cd translator -
Install the required dependencies:
pip install googletrans==4.0.0-rc1
Run the script using:
python translator.py- Enter the text to translate.
- Enter the source language code (e.g.,
enfor English). - Enter the target language code (e.g.,
yofor Yoruba). - View the translated text.
Enter text: Hello, how are you?
Enter source language code: en
Enter target language code: fr
Original Text: Hello, how are you?
Translated Text: Bonjour, comment allez-vous?
The software supports multiple language codes, such as:
- English:
en - Yoruba:
yo - Hausa:
ha - Igbo:
ig - French:
fr - Spanish:
es - And many more...
- The
googletranslibrary may sometimes fail due to API limitations. - The script may not work properly with certain special characters.
Developed by Uche Blessed