deepl-java
deepl-java copied to clipboard
Mismatch between README and actual code
Hello !
I'm creating a small Java project that uses DeepL API and I faced a strange issue:
In the README, you state the following to instantiate a DeepLClient:
deepLClient = new DeepLClient(apiKey);
However, the code of DeepLClient (here) need an extra TranslatorOptions. In addition, this TranslatorOptions is deprecated and the new DeepLClientOptions is as well.
Perhaps I'm getting ahead of myself, but I believe there may be a mistake here.
Not only that, but I see a deprecation notice on all methods for DeepLClient and DeepLClientOptions, which can't be correct.
https://github.com/DeepLcom/deepl-java/blob/9087e775804e7ac7c859661f9a1c1be4e4ced424/deepl-java/src/main/java/com/deepl/api/Translator.java#L23 https://github.com/DeepLcom/deepl-java/blob/9087e775804e7ac7c859661f9a1c1be4e4ced424/deepl-java/src/main/java/com/deepl/api/TranslatorOptions.java#L23
Maybe they should be annotated something like @Internal instead?
Sorry, this was fixed in 1.8.1 . I realized too late that deprecating class Translator would deprecate methods in it that other classes inherit as well. I fixed it now to only deprecate creating new instances of the Translator, as DeepLClient should be used going forward.
You should now be able to instantiate new DeepLClient objects both with
client = new DeepLClient(apiKey);
and
client = new DeepLClient(apiKey, new DeepLClientOptions());