Suppose you want to translate an English word "Hello" to Simplified Chinese with DeepL API via BartyCrouch.
Currently, BartyCrouch sends a request like this:
Set ZH rather than Zh-Hans for target_lang and source_lang
I didn't do this for Traditional Chinese because DeepL's ZH is actually for Simplified Chinese but I have no strong opinion. Please feel free to suggest me doing this for Traditional Chinese too.
Change the values of target_lang and source_lang to UPPER CASE from Capitalised Case
This is a kind of refactoring. As of now, both uppercased and capitalized work fine, but I guess we better to use the documented case.
(No related issue)
Problem
Suppose you want to translate an English word "Hello" to Simplified Chinese with DeepL API via BartyCrouch. Currently, BartyCrouch sends a request like this:
But DeepL doesn't allow
Zh-Hans
fortarget_lang
norsource_lang
, so they always return 400 Bad Request.This is the documentation of what they allow: https://www.deepl.com/docs-api/translating-text/request/
Proposed Changes
ZH
rather thanZh-Hans
fortarget_lang
andsource_lang
ZH
is actually for Simplified Chinese but I have no strong opinion. Please feel free to suggest me doing this for Traditional Chinese too.target_lang
andsource_lang
to UPPER CASE from Capitalised CaseSo this PR will change the above URL into this: