OmarEinea / TranslateToArabic

A set of python 3 scrapers to translate English text to Arabic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

English to Arabic Translators

This is a python 3 web scraping script to translate English text to Arabic,
using the web browser automation tool Selenium.

The translation is done using the service provided by freetranslations.org

How to Use?

Instantiate a Translator object, then call translate(text) on it like so:

from Translator import Translator

tr = Translator()

text = input("Type Something: ")
print(tr.translate(text))

Note: you could pass True to Translator to make it headless.

Installation

Install Selenium using:

pip install selenium

Then download Chrome WebDriver from here, then extract and place it in the same folder.

Contents

  • Translator.py: A class which opens the browser and provide a function to translate text.
  • Sample.py: A simple script that demonstrates the use of Translator on a text file.

References

About

A set of python 3 scrapers to translate English text to Arabic


Languages

Language:Python 100.0%