Publisher does not support the Fluid field type. Please do not contact asking when support will be available.
If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.
Ticket: Publisher allows use of language codes that crash DeepL ...
Status | Resolved |
Add-on / Version | Publisher 3.7.4 |
Severity | |
EE Version | 6.3.5 |
Gavin @ JCOGS
Sep 26, 2022Currently it is possible to enter a language code into Publisher that will crash DeepL’s Auto-Translate if used.
For example, set up a language PT and then enable AutoTranslate and you get this exception error from DeepL
DeepL\DeepLException Caught
targetLang="pt" is deprecated, please use "pt-PT" or "pt-BR" instead.
user/addons/publisher/vendor/deeplcom/deepl-php/src/Translator.php:356
Stack Trace: Please include when reporting this error
You need to add a cross-check that the Publisher language code being used appears in the DeepL listing of available target languages before submitting an API request - there is a simple listing utility for this in WebAPI so presumably also in php API.
BoldMinded (Brian)
Sep 26, 2022
Yeah, I did this for EN, missed that this applies to PT too. I’ll send you an update in a bit.
BoldMinded (Brian)
Sep 26, 2022
Comment has been marked private.
Gavin @ JCOGS
Sep 26, 2022
Ace - test build is better. One question though - if you enter PT for the language is it defaulting to PT-PT for the translation? Good if it is, just need to check (as client wants both PT-PT and PT-BR versions eventually, would be useful to know if Publisher sees PT-PT and PT as ‘different’ languages (and so will require two lots of translation).
BoldMinded (Brian)
Sep 27, 2022
Yes, they’re different. If you want pt and pt-br, you’ll need to create a different language. It’s up to you if you want the default Portuguese to be pt or pt-pt.
Gavin @ JCOGS
Sep 27, 2022
So I set the default PT language code by setting the language code associated with the “Portuguese” language setting in Publisher to pt rather than pt-pt?
BoldMinded (Brian)
Sep 27, 2022
It’s up to you, it can be either or. I added a check in Publisher so if you use the short language code of “pt” it’ll convert it to “pt-pt” when making the request to DeepL.
Gavin @ JCOGS
Sep 27, 2022
Bril - thanks for the clarification.