Skip to content

Files

Latest commit

 

History

History
 
 

Language Translator

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Translation Script

This Python script allows you to translate a string of text into the language of your choice using the Google Translate service.

Prerequisites

  • Python 3.x
  • googletrans library (version 4.0.0-rc1 or later)

Installation

  1. Clone the repository.

  2. Install the required dependencies using the following command:

    pip install googletrans==4.0.0-rc1
    

Usage

  1. Open a terminal or command prompt.

  2. Navigate to the directory where the script is located.

  3. Run the script using the following command:

    python language_translator.py
    
  4. Enter the text you want to translate when prompted.

  5. Enter the target language code (e.g., 'fr' for French, 'es' for Spanish) when prompted. You can refer to the Google Translate language codes for a list of supported languages.

  6. The script will output the translated text.

Example

Here's an example of how to use the translation script:

Enter the text you want to translate: Hello, how are you?
Enter the target language (e.g., 'fr' for French, 'es' for Spanish): es
Translated text: ¡Hola, cómo estás?