Skip to content

Commit

Permalink
feat: New languages Korean (ko) and Norwegian (bokmål) (nb): add lang…
Browse files Browse the repository at this point in the history
…uage code constants and tests
  • Loading branch information
daniel-jones-dev committed Jan 26, 2023
1 parent 9b0f717 commit a8c2bc7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions deepl-java/src/main/java/com/deepl/api/LanguageCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
4 changes: 2 additions & 2 deletions deepl-java/src/test/java/com/deepl/api/GeneralTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions deepl-java/src/test/java/com/deepl/api/TestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit a8c2bc7

Please sign in to comment.