Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Apparent bug in DeepLTranslator
Hi all,
I was toying around with translators and was trying DeepL but got an error:
Target language code en is not among the supported langauge codes: BG, CS, DA, DE, EL, EN, ES, ET, FI, FR, HU, ID, IT, JA, KO, LT, LV, NB, NL, PL, PT, RO, RU, SK, SL, SV, TR, UK, ZH
This seems to come from liferay-portal/modules/apps/translation/translation-translator-deepl/src/main/java/com/liferay/translation/translator/deepl/internal/translator/DeepLTranslator.java
This piece of code is comparing lowercase string with uppercase strings and fails.Possibly the JSON data has changed format after the code was written?
if (!supportedLanguageCodes.contains(targetLanguageCode)) {
throw new TranslatorException(
StringBundler.concat(
"Target language code ", targetLanguageCode,
" is not among the supported langauge codes: ",
StringUtil.merge(
supportedLanguageCodes, StringPool.COMMA_AND_SPACE)));
HTH
Fernando