backend: allow for source lang to be overridden in note/translate #160
Loading…
Reference in a new issue
No description provided.
Delete branch "backend-translate-source-lang"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This adds a new optional
sourceLang
parameter to thenotes/translate
endpoint. If not set, the old behaviour is used, else this sets the
source_lang
parameter to the DeepL API call which makes it use thesource language specified instead of using autodetection.
Changelog: Changed
Ref: #33
This will only contain the backend part as I'm still not decided on how it'll be done on the frontend.
e2ac97a5fc
to644c423643
If this is supposed to cover all the backend parts of #33, you'll need to adjust the target language part too, to accept
EN-GB
andEN-US
as well asPT-BR
andPT-PT
. (see also https://www.deepl.com/docs-api/translate-text/translate-text/)If you want to be extra strict you could add
enum
validation to source and target language as well.Not sure if what I came up with was what you had in mind, but I'm not sure if there's a better way (still kinda new to this sort of stuff).
No, sorry that is not what I meant. You can use the JSON schema
enum
key of the endpoint inparamDef
to make use of the existing validation. Something like this:oh that makes MUCH more sense.
6875a47fbb
toc068294c51
c068294c51
tod5d8affc33