Skip to content
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 @@ -125,6 +125,7 @@
"persian": "fa",
"polish": "pl",
"portuguese": "pt",
"portuguese (portugal)": "pt-PT",
"punjabi": "pa",
"quechua": "qu",
"romanian": "ro",
Expand Down
14 changes: 11 additions & 3 deletions tests/test_google.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ def test_payload(google_translator):


def test_one_character_words():
assert (
GoogleTranslator(source="es", target="en").translate("o") is not None
)
assert GoogleTranslator(source="es", target="en").translate("o") is not None


def test_european_portuguese():
engine_pt = GoogleTranslator(source="en", target="pt-PT")
translation_pt = engine_pt.translate("The bus arrived late")
assert translation_pt == "O autocarro chegou atrasado"

engine_br = GoogleTranslator(source="en", target="pt")
translation_br = engine_br.translate("The bus arrived late")
assert translation_br == "O ônibus chegou atrasado"