Merge pull request #46 from RubenEu/hotfix-batch-words
Browse files
deep_translator/linguee.py
CHANGED
|
@@ -125,6 +125,6 @@ class LingueeTranslator(BaseTranslator):
|
|
| 125 |
|
| 126 |
translated_words = []
|
| 127 |
for word in words:
|
| 128 |
-
translated_words.append(self.translate(
|
| 129 |
return translated_words
|
| 130 |
|
|
|
|
| 125 |
|
| 126 |
translated_words = []
|
| 127 |
for word in words:
|
| 128 |
+
translated_words.append(self.translate(word=word))
|
| 129 |
return translated_words
|
| 130 |
|
deep_translator/pons.py
CHANGED
|
@@ -131,6 +131,6 @@ class PonsTranslator(BaseTranslator):
|
|
| 131 |
|
| 132 |
translated_words = []
|
| 133 |
for word in words:
|
| 134 |
-
translated_words.append(self.translate(
|
| 135 |
return translated_words
|
| 136 |
|
|
|
|
| 131 |
|
| 132 |
translated_words = []
|
| 133 |
for word in words:
|
| 134 |
+
translated_words.append(self.translate(word=word))
|
| 135 |
return translated_words
|
| 136 |
|
deep_translator/tests/test_linguee.py
CHANGED
|
@@ -49,5 +49,10 @@ def test_payload(linguee):
|
|
| 49 |
linguee.translate("a"*51)
|
| 50 |
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
def test_one_character_words():
|
| 53 |
assert LingueeTranslator(source='es', target='en').translate('y') == 'and'
|
|
|
|
| 49 |
linguee.translate("a"*51)
|
| 50 |
|
| 51 |
|
| 52 |
+
|
| 53 |
+
def test_translate_words(linguee):
|
| 54 |
+
words = ['hello', 'world']
|
| 55 |
+
translated_words = linguee.translate_words(words)
|
| 56 |
+
|
| 57 |
def test_one_character_words():
|
| 58 |
assert LingueeTranslator(source='es', target='en').translate('y') == 'and'
|
deep_translator/tests/test_pons.py
CHANGED
|
@@ -48,5 +48,10 @@ def test_payload(pons):
|
|
| 48 |
pons.translate("a" * 51)
|
| 49 |
|
| 50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
def test_one_character_words(pons):
|
| 52 |
assert pons.translate('I')
|
|
|
|
| 48 |
pons.translate("a" * 51)
|
| 49 |
|
| 50 |
|
| 51 |
+
|
| 52 |
+
def test_translate_words(pons):
|
| 53 |
+
words = ['hello', 'world']
|
| 54 |
+
translated_words = pons.translate_words(words)
|
| 55 |
+
|
| 56 |
def test_one_character_words(pons):
|
| 57 |
assert pons.translate('I')
|