DeepLcom / deepl-python

Official Python library for the DeepL language translation API.
MIT License
1.06k stars 75 forks source link

When translating long English fields into Chinese, the last paragraph was lost #98

Open Yin-1 opened 3 months ago

Yin-1 commented 3 months ago

original sentence->Together with the supervisory board,we will propose a dividend of 2 euros and 45 cents per share to the annual general meeting in may。This is in line with our dividend policy representing 100% of the affo while keeping net proceeds from disposals of around 55 million euros to strengthen the company's balance sheet。We consider this proposal to be a balanced approach between a cash return for our shareholders and capital preservation to strengthen the balance sheet at the same time。

result->我们将与监事会一起,向五月份的年度股东大会提议每股分红 2 欧元 45 美分。这符合我们的分红政策,即在保留约 5,500 万欧元处置净收益以加强公司资产负债表的同时,分红 100%。

Oddly enough, when I added a newline before , the translation worked

`import deepl from MY_CONSTANTS import MyConstants

en = """ Together with the supervisory board,we will propose a dividend of 2 euros and 45 cents per share to the annual general meeting in may。This is in line with our dividend policy representing 100% of the affo while keeping net proceeds from disposals of around 55 million euros to strengthen the company's balance sheet。We consider this proposal to be a balanced approach between a cash return for our shareholders and capital preservation to strengthen the balance sheet at the same time。 """ translator = deepl.Translator(MyConstants.DEEPL_KEY.value) result = translator.translate_text(en, target_lang="ZH") print(result)`

help,that's terrible