Skip to content

Commit

Permalink
fix: formality=default is allowed for all target languages
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-jones-dev committed Nov 10, 2022
1 parent cd2c1e5 commit 47e3d91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [Unreleased]
### Fixed
* `formality=default` is allowed for all target languages.


## [1.9.0] - 2022-11-03
### Added
* Add to supported glossary language pairs:
Expand Down Expand Up @@ -144,6 +149,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Initial version.


[Unreleased]: https://github.com/DeepLcom/deepl-mock/compare/v1.9.0...HEAD
[1.9.0]: https://github.com/DeepLcom/deepl-mock/compare/v1.8.1...v1.9.0
[1.8.1]: https://github.com/DeepLcom/deepl-mock/compare/v1.8.0...v1.8.1
[1.8.0]: https://github.com/DeepLcom/deepl-mock/compare/v1.7.0...v1.8.0
Expand Down
1 change: 1 addition & 0 deletions languages.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ function isGlossaryLanguage(langCode) {

function supportsFormality(langCode, formality) {
if (langCode === undefined) return false;
if (formality === 'default') return true;
if (formality !== undefined && formality.startsWith('prefer_')) return true;
const langCodeUpper = langCode.toUpperCase();
return languages.has(langCodeUpper) && languages.get(langCodeUpper).formality !== undefined;
Expand Down

0 comments on commit 47e3d91

Please sign in to comment.