Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Fongbe to Supported languages in Google Translate #264

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deep_translator/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"ewe": "ee",
"filipino": "tl",
"finnish": "fi",
"fongbe":"fon",
"french": "fr",
"frisian": "fy",
"galician": "gl",
Expand Down
16 changes: 8 additions & 8 deletions docs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ Features
Installation
=============

Install the stable release:
Install this release:

.. code-block:: console

$ pip install -U deep-translator
$ pip install git+https://github.com/beethogedeon/deep-translator.git

$ poetry add deep-translator # for poetry usage

Expand Down Expand Up @@ -277,16 +277,16 @@ Google Translate

.. code-block:: python

translated = GoogleTranslator(source='auto', target='de').translate(text=text)
translated = GoogleTranslator(source='auto', target='fon').translate(text=text)

- You can pass languages by name or by abbreviation:

.. code-block:: python

translated = GoogleTranslator(source='auto', target='german').translate(text=text)
translated = GoogleTranslator(source='auto', target='fongbe').translate(text=text)

# Alternatively, you can pass languages by their abbreviation:
translated = GoogleTranslator(source='en', target='de').translate(text=text)
translated = GoogleTranslator(source='fon', target='fr').translate(text=text)

- You can also reuse the Translator class and change/update its properties.

Expand All @@ -295,15 +295,15 @@ Google Translate

.. code-block:: python

# let's say first you need to translate from auto to german
my_translator = GoogleTranslator(source='auto', target='german')
# let's say first you need to translate from auto to Fongbe
my_translator = GoogleTranslator(source='auto', target='fongbe')
result = my_translator.translate(text=text)
print(f"Translation using source = {my_translator.source} and target = {my_translator.target} -> {result}")

# let's say later you want to reuse the class but your target is french now
# This is the best practice and how you should use deep-translator.
# Please don't over-instantiate translator objects without a good reason, otherwise you will run into performance issues
my_translator.target = 'fr' # this will override the target 'german' passed previously
my_translator.target = 'fr' # this will override the target 'fongbe' passed previously
result = my_translator.translate(text=text)
print(f"Translation using source = {my_translator.source} and target = {my_translator.target} -> {result}")

Expand Down