Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding the formality and glossary feature to DeepL #65

Open
BreakerZero opened this issue Jul 21, 2022 · 5 comments
Open

Consider adding the formality and glossary feature to DeepL #65

BreakerZero opened this issue Jul 21, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@BreakerZero
Copy link

At first sight, it seems that it is only a matter of adding some formated fields to the JSONRPC request:

Capture d’écran 2022-07-21 172845

For formality:

  • Options available: "formal", "informal", null
  • Even though it is a "premium" feature, DeepL returns the correct tone if entered (output obtained without the tone: "Vous êtes".):
    Capture d’écran 2022-07-21 174721

For glossary (named dictionary in the json):

  • The only pairs in the glossary that are sent are those where the target text is in the target language that the user has chosen.
  • The glossary pairs are visibly sorted according to the order of the letters in the unicode table. (only the source text matters)
  • The same source text cannot have several translations (the previous pair is overwritten if this is the case)
  • A source text/target text pair is separated by '\t', two different pairs are separated by '\n'.
  • Backslash is escaped if used.

Notes:

  • browserType is optional.
  • There must be another requirement to generate a correct glossary, because after some tests I get the error -32600 which corresponds to :Invalid Request 'Invalid commonJobParams'
@Animenosekai
Copy link
Owner

Thank you for reaching out and for this very detailed explanation !

I'm currently in vacation but I'll definitely look into it.

Also, I think that we'll add a "raw" attribute to the result models for the raw response and that we will make specific models for different translators.

@ZhymabekRoman
Copy link
Contributor

I'm currently in vacation

Same thing, I won't be able to work on projects until September, if you need any help ping me. After rest we will start work on v3 😅

@Animenosekai
Copy link
Owner

Animenosekai commented Jul 23, 2022

Same thing, I won't be able to work on projects until September, if you need any help ping me. After rest we will start work on v3 😅

I might greatly progress into v3 in August, since I already made lots of changes in the website branch 😎

@Animenosekai Animenosekai added the enhancement New feature or request label Aug 13, 2022
@Animenosekai Animenosekai mentioned this issue Feb 23, 2023
27 tasks
@ZhymabekRoman
Copy link
Contributor

Done in #95. Just pass formality keyword argument to function:

from translatepy.translators.deepl import DeeplTranslateV2
dl = DeeplTranslateV2()
dl.translate("You are", "fr", formality="formal")

@Animenosekai
Copy link
Owner

This feature will come in the v3 (available now on the next branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants