I got a report on my talk page about automatic translation failing when translating from de -> en
Quoting Laura240406
I wanted to translate a page a few days ago but the tools failed with "Automatic translation failed". So I looked at the network log and the endpoint at https://cxserver.wikimedia.org/v2/translate/de/en/ returned "Authorization header is missing".
A git clone and grep later, I found out that this comes from line 117 in cxserver/lib/routes/v1.js, which was introduced in commit f8852f1e by you (as far as I can tell with git blame).
Is my diagnosis right and, if so, could you please fix the issue?
I investigated the issue and here's what I found:
The patch in question (f8852f1e) hasn't yet been deployed on production server yet so that cannot be the issue.
The issue was likely caused by this patch: 1119179: Use default provider if none is provided when making MT translations | https://gerrit.wikimedia.org/r/c/mediawiki/services/cxserver/+/1119179 submitted to fix T386231: /v2/translate API fails to perform any translation when no provider is provided. This patch has a side-effect where if an error occurs while creating the MT Client, cxserver returns the error to the client. Previously, the default MT provider was not being used at all.
The patch (f8852f1e) handles these MT Client errors, and continues processing so when that is deployed it should fix this issue.
The other issue I see is with how CX handles MT being disabled for certain Wikipedias. While testing this issue, I tried translating an article from de -> en: https://en.wikipedia.org/wiki/Special:ContentTranslation?title=Especial:ContentTranslation&campaign=specialcx&from=de&to=en&page=Dithmarschen
The change in behavior breaks CX when "copy content" is selected so I think we should "revert" the change made for T386231: /v2/translate API fails to perform any translation when no provider is provided and update the documentation.
