<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Apparent bug in DeepLTranslator</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=122767799" />
  <subtitle>Apparent bug in DeepLTranslator</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=122767799</id>
  <updated>2026-05-17T08:01:56Z</updated>
  <dc:date>2026-05-17T08:01:56Z</dc:date>
  <entry>
    <title>Apparent bug in DeepLTranslator</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122767798" />
    <author>
      <name>Fernando Fernandez</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122767798</id>
    <updated>2024-07-09T14:04:12Z</updated>
    <published>2024-07-09T14:04:10Z</published>
    <summary type="html">&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;I was toying around with translators and was trying DeepL but got an error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;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&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This seems to come from&amp;nbsp;liferay-portal/modules/apps/translation/translation-translator-deepl/src/main/java/com/liferay/translation/translator/deepl/internal/translator/DeepLTranslator.java&amp;nbsp;&lt;/p&gt;
&lt;p&gt;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?&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-java"&gt;		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)));&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;HTH&lt;/p&gt;
&lt;p&gt;Fernando&lt;/p&gt;</summary>
    <dc:creator>Fernando Fernandez</dc:creator>
    <dc:date>2024-07-09T14:04:10Z</dc:date>
  </entry>
</feed>
