From a8c2bc7c2213337c519e9cebae539c9bb345d39b Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Mon, 2 Jan 2023 15:02:37 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20New=20languages=20Korean=20(ko)=20and?= =?UTF-8?q?=20Norwegian=20(bokm=C3=A5l)=20(nb):=20add=20language=20code=20?= =?UTF-8?q?constants=20and=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 +++++ deepl-java/src/main/java/com/deepl/api/LanguageCode.java | 6 ++++++ deepl-java/src/test/java/com/deepl/api/GeneralTest.java | 4 ++-- deepl-java/src/test/java/com/deepl/api/TestBase.java | 2 ++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6b168d..93fe55c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added * Add example maven project using this library. +* New languages available: Korean (`'ko'`) and Norwegian (bokmål) (`'nb'`). Add + language code constants and tests. + + Note: older library versions also support the new languages, this update only + adds new code constants. ### Changed ### Deprecated ### Removed diff --git a/deepl-java/src/main/java/com/deepl/api/LanguageCode.java b/deepl-java/src/main/java/com/deepl/api/LanguageCode.java index 95893df..bbba689 100644 --- a/deepl-java/src/main/java/com/deepl/api/LanguageCode.java +++ b/deepl-java/src/main/java/com/deepl/api/LanguageCode.java @@ -62,12 +62,18 @@ public class LanguageCode { /** Japanese language code, may be used as source or target language. */ public static final String Japanese = "ja"; + /** Korean language code, may be used as source or target language. */ + public static final String Korean = "ko"; + /** Lithuanian language code, may be used as source or target language. */ public static final String Lithuanian = "lt"; /** Latvian language code, may be used as source or target language. */ public static final String Latvian = "lv"; + /** Norwegian (bokmål) language code, may be used as source or target language. */ + public static final String Norwegian = "nb"; + /** Dutch language code, may be used as source or target language. */ public static final String Dutch = "nl"; diff --git a/deepl-java/src/test/java/com/deepl/api/GeneralTest.java b/deepl-java/src/test/java/com/deepl/api/GeneralTest.java index 12718d5..c545366 100644 --- a/deepl-java/src/test/java/com/deepl/api/GeneralTest.java +++ b/deepl-java/src/test/java/com/deepl/api/GeneralTest.java @@ -70,7 +70,7 @@ void testGetSourceAndTargetLanguages() throws DeepLException, InterruptedExcepti } Assertions.assertNull(language.getSupportsFormality()); } - Assertions.assertTrue(sourceLanguages.size() > 20); + Assertions.assertTrue(sourceLanguages.size() >= 29); for (Language language : targetLanguages) { Assertions.assertNotNull(language.getSupportsFormality()); @@ -79,7 +79,7 @@ void testGetSourceAndTargetLanguages() throws DeepLException, InterruptedExcepti Assertions.assertEquals("German", language.getName()); } } - Assertions.assertTrue(targetLanguages.size() > 20); + Assertions.assertTrue(targetLanguages.size() >= 31); } @Test diff --git a/deepl-java/src/test/java/com/deepl/api/TestBase.java b/deepl-java/src/test/java/com/deepl/api/TestBase.java index 09c09bc..b3b6398 100644 --- a/deepl-java/src/test/java/com/deepl/api/TestBase.java +++ b/deepl-java/src/test/java/com/deepl/api/TestBase.java @@ -64,8 +64,10 @@ public class TestBase { exampleText.put("id", "berkas proton"); exampleText.put("it", "fascio di protoni"); exampleText.put("ja", "陽子ビーム"); + exampleText.put("ko", "양성자 빔"); exampleText.put("lt", "protonų spindulys"); exampleText.put("lv", "protonu staru kūlis"); + exampleText.put("nb", "protonstråle"); exampleText.put("nl", "protonenbundel"); exampleText.put("pl", "wiązka protonów"); exampleText.put("pt", "feixe de prótons");