sinedie / SRTranslator

SRT files translator
Do What The F*ck You Want To Public License
219 stars 27 forks source link

KeyError: 'zh-Hant' #92

Closed h9052300 closed 4 months ago

h9052300 commented 4 months ago

from srtranslator.translators.deepl_scrap import DeeplTranslator

translator = DeeplTranslator(driver=driver)

oo = translator.translate("going to pull the small one for auto completion and a big one for actually", 'en', "zh-Hant") print(oo)

translator.quit()

Traceback (most recent call last): File "C:\Users\user\Desktop\Python Project\flask_view\videoToOOXX\srtranslatorTest.py", line 61, in oo = translator.translate("going to pull the small one for auto completion and a big one for actually", 'en', "zh-Hant") File "C:\Users\user\Desktop\Python Project\flask_view\venv\lib\site-packages\srtranslator\translators\deepl_scrap.py", line 137, in translate self._set_destination_language(destination_language) File "C:\Users\user\Desktop\Python Project\flask_view\venv\lib\site-packages\srtranslator\translators\deepl_scrap.py", line 108, in _set_destination_language self._set_language(language, "//*[@data-testid='translator-target-lang']") File "C:\Users\user\Desktop\Python Project\flask_view\venv\lib\site-packages\srtranslator\translators\deepl_scrap.py", line 119, in _set_language x_path_by_text = f"//button[text()='{self.languages[language]}']" KeyError: 'zh-Hant'

sorry! How can I adjust it?

sinedie commented 4 months ago

That was my bad. It is fixed by now

Im uploading the new version to PyPi

sinedie commented 4 months ago

Version 0.3.8 fix it, already in PyPi